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.
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
class AddTranslateMilestones < ActiveRecord::Migration
|
||||
def self.up
|
||||
Budget::Investment::Milestone.create_translation_table!({
|
||||
title: :string,
|
||||
description: :text
|
||||
})
|
||||
Budget::Investment::Milestone.create_translation_table!(
|
||||
{
|
||||
title: :string,
|
||||
description: :text
|
||||
},
|
||||
{ migrate_data: true }
|
||||
)
|
||||
end
|
||||
|
||||
def self.down
|
||||
|
||||
@@ -6,7 +6,10 @@ class CreateI18nContentTranslations < ActiveRecord::Migration
|
||||
|
||||
reversible do |dir|
|
||||
dir.up do
|
||||
I18nContent.create_translation_table! :value => :text
|
||||
I18nContent.create_translation_table!(
|
||||
{ value: :text },
|
||||
{ migrate_data: true }
|
||||
)
|
||||
end
|
||||
|
||||
dir.down do
|
||||
|
||||
@@ -2,8 +2,11 @@ class AddBannerTranslations < ActiveRecord::Migration
|
||||
|
||||
def self.up
|
||||
Banner.create_translation_table!(
|
||||
title: :string,
|
||||
description: :text
|
||||
{
|
||||
title: :string,
|
||||
description: :text
|
||||
},
|
||||
{ migrate_data: true }
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
@@ -2,10 +2,13 @@ class AddHomepageContentTranslations < ActiveRecord::Migration
|
||||
|
||||
def self.up
|
||||
Widget::Card.create_translation_table!(
|
||||
label: :string,
|
||||
title: :string,
|
||||
description: :text,
|
||||
link_text: :string
|
||||
{
|
||||
label: :string,
|
||||
title: :string,
|
||||
description: :text,
|
||||
link_text: :string
|
||||
},
|
||||
{ migrate_data: true }
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
@@ -2,9 +2,12 @@ class AddPollTranslations < ActiveRecord::Migration
|
||||
|
||||
def self.up
|
||||
Poll.create_translation_table!(
|
||||
name: :string,
|
||||
summary: :text,
|
||||
description: :text
|
||||
{
|
||||
name: :string,
|
||||
summary: :text,
|
||||
description: :text
|
||||
},
|
||||
{ migrate_data: true }
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
@@ -2,8 +2,11 @@ class AddAdminNotificationTranslations < ActiveRecord::Migration
|
||||
|
||||
def self.up
|
||||
AdminNotification.create_translation_table!(
|
||||
title: :string,
|
||||
body: :text
|
||||
{
|
||||
title: :string,
|
||||
body: :text
|
||||
},
|
||||
{ migrate_data: true }
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
@@ -2,7 +2,8 @@ class AddPollQuestionTranslations < ActiveRecord::Migration
|
||||
|
||||
def self.up
|
||||
Poll::Question.create_translation_table!(
|
||||
title: :string
|
||||
{ title: :string },
|
||||
{ migrate_data: true }
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
@@ -2,8 +2,11 @@ class AddPollQuestionAnswerTranslations < ActiveRecord::Migration
|
||||
|
||||
def self.up
|
||||
Poll::Question::Answer.create_translation_table!(
|
||||
title: :string,
|
||||
description: :text
|
||||
{
|
||||
title: :string,
|
||||
description: :text
|
||||
},
|
||||
{ migrate_data: true }
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
@@ -2,25 +2,33 @@ class AddCollaborativeLegislationTranslations < ActiveRecord::Migration
|
||||
|
||||
def self.up
|
||||
Legislation::Process.create_translation_table!(
|
||||
title: :string,
|
||||
summary: :text,
|
||||
description: :text,
|
||||
additional_info: :text,
|
||||
{
|
||||
title: :string,
|
||||
summary: :text,
|
||||
description: :text,
|
||||
additional_info: :text,
|
||||
},
|
||||
{ migrate_data: true }
|
||||
)
|
||||
|
||||
Legislation::Question.create_translation_table!(
|
||||
title: :text
|
||||
{ title: :text },
|
||||
{ migrate_data: true }
|
||||
)
|
||||
|
||||
Legislation::DraftVersion.create_translation_table!(
|
||||
title: :string,
|
||||
changelog: :text,
|
||||
body: :text,
|
||||
body_html: :text,
|
||||
toc_html: :text
|
||||
{
|
||||
title: :string,
|
||||
changelog: :text,
|
||||
body: :text,
|
||||
body_html: :text,
|
||||
toc_html: :text
|
||||
},
|
||||
{ migrate_data: true }
|
||||
)
|
||||
Legislation::QuestionOption.create_translation_table!(
|
||||
value: :string
|
||||
{ value: :string },
|
||||
{ migrate_data: true }
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
class AddTranslatePages < ActiveRecord::Migration
|
||||
def self.up
|
||||
SiteCustomization::Page.create_translation_table!({
|
||||
title: :string,
|
||||
subtitle: :string,
|
||||
content: :text
|
||||
})
|
||||
SiteCustomization::Page.create_translation_table!(
|
||||
{
|
||||
title: :string,
|
||||
subtitle: :string,
|
||||
content: :text
|
||||
},
|
||||
{ migrate_data: true }
|
||||
)
|
||||
|
||||
change_column :site_customization_pages, :title, :string, :null => true
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user