Created
March 3, 2012 07:00
-
-
Save jadehopepunk/1964785 to your computer and use it in GitHub Desktop.
Migration to convert from refinery 1.0.8 to refinery 2.0
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 UpgradeToRefineryTwo < ActiveRecord::Migration | |
def self.up | |
# For refinerycms-authentication | |
rename_table :roles_users, :refinery_roles_users | |
rename_table :roles, :refinery_roles | |
rename_table :user_plugins, :refinery_user_plugins | |
rename_table :users, :refinery_users | |
remove_column :refinery_users, :persistence_token | |
remove_column :refinery_users, :perishable_token | |
remove_column :refinery_users, :remember_token | |
add_column :refinery_users, :reset_password_sent_at, :datetime | |
# For refinerycms-pages | |
rename_table :page_parts, :refinery_page_parts | |
rename_column :refinery_page_parts, :page_id, :refinery_page_id | |
rename_table :pages, :refinery_pages | |
add_column :refinery_pages, :slug, :string | |
add_column :refinery_pages, :view_template, :string | |
add_column :refinery_pages, :layout_template, :string | |
rename_column :refinery_pages, :position, :unused_position | |
# For refinerycms-images | |
rename_table :images, :refinery_images | |
# For refinerycms-resources | |
rename_table :resources, :refinery_resources | |
# For refinerycms-i18n | |
rename_table :page_translations, :refinery_page_translations | |
rename_column :refinery_page_translations, :page_id, :refinery_page_id | |
add_column :refinery_page_translations, :slug, :string | |
add_column :refinery_page_translations, :menu_title, :string | |
add_column :refinery_page_translations, :custom_slug, :string | |
remove_column :refinery_page_translations, :custom_title | |
rename_table :page_part_translations, :refinery_page_part_translations | |
rename_column :refinery_page_part_translations, :page_part_id, :refinery_page_part_id | |
end | |
def self.down | |
raise NotImplementedError | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you're using engines, you need to account for them as well. This is mine for news and blog: