Files
grecia/db/migrate/20180801140800_add_collaborative_legislation_translations.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

42 lines
1.0 KiB
Ruby

class AddCollaborativeLegislationTranslations < ActiveRecord::Migration
def self.up
Legislation::Process.create_translation_table!(
{
title: :string,
summary: :text,
description: :text,
additional_info: :text,
},
{ migrate_data: true }
)
Legislation::Question.create_translation_table!(
{ title: :text },
{ migrate_data: true }
)
Legislation::DraftVersion.create_translation_table!(
{
title: :string,
changelog: :text,
body: :text,
body_html: :text,
toc_html: :text
},
{ migrate_data: true }
)
Legislation::QuestionOption.create_translation_table!(
{ value: :string },
{ migrate_data: true }
)
end
def self.down
Legislation::Process.drop_translation_table!
Legislation::DraftVersion.drop_translation_table!
Legislation::Question.drop_translation_table!
Legislation::QuestionOption.drop_translation_table!
end
end