DEPRECATION WARNING: Directly inheriting from ActiveRecord::Migration is deprecated. Please specify the Rails release the migration was written for: class MigrationClass < ActiveRecord::Migration[4.2] (called from require at bin/rails:4)
20 lines
493 B
Ruby
20 lines
493 B
Ruby
class AddTranslatePages < ActiveRecord::Migration[4.2]
|
|
def self.up
|
|
SiteCustomization::Page.create_translation_table!(
|
|
{
|
|
title: :string,
|
|
subtitle: :string,
|
|
content: :text
|
|
},
|
|
{ migrate_data: true }
|
|
)
|
|
|
|
change_column :site_customization_pages, :title, :string, :null => true
|
|
end
|
|
|
|
def self.down
|
|
SiteCustomization::Page.drop_translation_table!
|
|
change_column :site_customization_pages, :title, :string, :null => false
|
|
end
|
|
end
|