Files
nairobi/db/migrate/20180924071722_add_translate_pages.rb
Javi Martín b5eeb3f32f Apply Style/HashSyntax rubocop rule
We were already using it almost everywhere.
2019-10-26 13:03:49 +02:00

20 lines
487 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