Files
grecia/db/migrate/20180924071722_add_translate_pages.rb
Javi Martín be25e5fc45 Use migrate_data option for globalize
This way the task to migrate the data doesn't have to be run manually if
these migrations weren't already executed.
2018-10-23 16:29:13 +02:00

20 lines
488 B
Ruby

class AddTranslatePages < ActiveRecord::Migration
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