Created
June 4, 2013 14:02
-
-
Save dcvezzani/5706165 to your computer and use it in GitHub Desktop.
When generating a custom content block type in BrowserCms, the migration generated uses 'def change'. A down migration doesn't appear to work and it is required to go back to the self.up and self.down notation.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CreateBcmsMy401kWidgets < ActiveRecord::Migration | |
def self.up | |
Cms::ContentType.create!(:name => "BcmsMy401k::Widget", :group_name => "BcmsMy401k::Widget") | |
create_content_table :bcms_my401k_widgets, :prefix=>false do |t| | |
t.integer :user_id | |
t.string :name | |
t.text :description | |
t.timestamps | |
end | |
end | |
def self.down | |
drop_table :bcms_my401k_widgets | |
ActiveRecord::Base.connection.execute "delete from content_types where name = 'BcmsMy401k::Widget'" | |
ActiveRecord::Base.connection.execute "delete from content_type_groups where name = 'BcmsMy401k::Widget'" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment