-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bring back removal of translatable columns
Globalize does not support having translatable columns with the same name in the original table and the translations table. We were planning to migrate to Mobility, but we aren't doing so before releasing version 1.1. We've also found a gotcha regarding having both columns: if we use the `update_column` method, which we use in rake tasks to speed up the process and in tests where we want to skip validations and callbacks, we update the column in the original table and no exception is raised. If we remove the column in the original table, we get an exception, which is what we want since our intention is to update the column in the translations table. With this change we're following the advice given by the Mobility lead developer: "If you don't need the columns, I think it would make sense to just remove them to avoid any edge case issues." This commit reverts commit 251326e.
- Loading branch information
Showing
21 changed files
with
151 additions
and
60 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
db/migrate/20190213150434_rename_old_translatable_attibutes_in_debates.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
class RenameOldTranslatableAttibutesInDebates < ActiveRecord::Migration[4.2] | ||
def change | ||
remove_index :debates, :title | ||
|
||
rename_column :debates, :title, :deprecated_title | ||
rename_column :debates, :description, :deprecated_description | ||
end | ||
end |
11 changes: 11 additions & 0 deletions
11
db/migrate/20190215152236_rename_old_translatable_attibutes_in_proposals.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class RenameOldTranslatableAttibutesInProposals < ActiveRecord::Migration[4.2] | ||
def change | ||
remove_index :proposals, :title | ||
remove_index :proposals, :summary | ||
|
||
rename_column :proposals, :title, :deprecated_title | ||
rename_column :proposals, :description, :deprecated_description | ||
rename_column :proposals, :summary, :deprecated_summary | ||
rename_column :proposals, :retired_explanation, :deprecated_retired_explanation | ||
end | ||
end |
5 changes: 5 additions & 0 deletions
5
db/migrate/20190218122530_rename_old_translatable_attibutes_in_comments.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class RenameOldTranslatableAttibutesInComments < ActiveRecord::Migration[4.2] | ||
def change | ||
rename_column :comments, :body, :deprecated_body | ||
end | ||
end |
6 changes: 6 additions & 0 deletions
6
db/migrate/20190218162141_rename_old_translatable_attibutes_in_budget_investments.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class RenameOldTranslatableAttibutesInBudgetInvestments < ActiveRecord::Migration[4.2] | ||
def change | ||
rename_column :budget_investments, :title, :deprecated_title | ||
rename_column :budget_investments, :description, :deprecated_description | ||
end | ||
end |
6 changes: 6 additions & 0 deletions
6
db/migrate/20190221154819_remove_deprecated_translatable_fields_from_banners.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class RemoveDeprecatedTranslatableFieldsFromBanners < ActiveRecord::Migration[4.2] | ||
def change | ||
remove_column :banners, :title, :string | ||
remove_column :banners, :description, :string | ||
end | ||
end |
7 changes: 7 additions & 0 deletions
7
db/migrate/20190221162450_remove_deprecated_translatable_fields_from_polls.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class RemoveDeprecatedTranslatableFieldsFromPolls < ActiveRecord::Migration[4.2] | ||
def change | ||
remove_column :polls, :name, :string | ||
remove_column :polls, :summary, :text | ||
remove_column :polls, :description, :text | ||
end | ||
end |
5 changes: 5 additions & 0 deletions
5
db/migrate/20190221162858_remove_deprecated_translatable_fields_from_poll_questions.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class RemoveDeprecatedTranslatableFieldsFromPollQuestions < ActiveRecord::Migration[4.2] | ||
def change | ||
remove_column :poll_questions, :title, :string | ||
end | ||
end |
6 changes: 6 additions & 0 deletions
6
...igrate/20190221163117_remove_deprecated_translatable_fields_from_poll_question_answers.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class RemoveDeprecatedTranslatableFieldsFromPollQuestionAnswers < ActiveRecord::Migration[4.2] | ||
def change | ||
remove_column :poll_question_answers, :title, :string | ||
remove_column :poll_question_answers, :description, :text | ||
end | ||
end |
6 changes: 6 additions & 0 deletions
6
db/migrate/20190221163818_remove_deprecated_translatable_fields_from_admin_notifications.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class RemoveDeprecatedTranslatableFieldsFromAdminNotifications < ActiveRecord::Migration[4.2] | ||
def change | ||
remove_column :admin_notifications, :title, :string | ||
remove_column :admin_notifications, :body, :text | ||
end | ||
end |
6 changes: 6 additions & 0 deletions
6
db/migrate/20190221164056_remove_deprecated_translatable_fields_from_milestones.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class RemoveDeprecatedTranslatableFieldsFromMilestones < ActiveRecord::Migration[4.2] | ||
def change | ||
remove_column :milestones, :title, :string | ||
remove_column :milestones, :description, :text | ||
end | ||
end |
7 changes: 7 additions & 0 deletions
7
...e/20190221164559_remove_deprecated_translatable_fields_from_legislation_draft_versions.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class RemoveDeprecatedTranslatableFieldsFromLegislationDraftVersions < ActiveRecord::Migration[4.2] | ||
def change | ||
remove_column :legislation_draft_versions, :title, :string | ||
remove_column :legislation_draft_versions, :changelog, :text | ||
remove_column :legislation_draft_versions, :body, :text | ||
end | ||
end |
8 changes: 8 additions & 0 deletions
8
...igrate/20190221164928_remove_deprecated_translatable_fields_from_legislation_processes.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
class RemoveDeprecatedTranslatableFieldsFromLegislationProcesses < ActiveRecord::Migration[4.2] | ||
def change | ||
remove_column :legislation_processes, :title, :string | ||
remove_column :legislation_processes, :summary, :text | ||
remove_column :legislation_processes, :description, :text | ||
remove_column :legislation_processes, :additional_info, :text | ||
end | ||
end |
5 changes: 5 additions & 0 deletions
5
...igrate/20190221165347_remove_deprecated_translatable_fields_from_legislation_questions.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class RemoveDeprecatedTranslatableFieldsFromLegislationQuestions < ActiveRecord::Migration[4.2] | ||
def change | ||
remove_column :legislation_questions, :title, :text | ||
end | ||
end |
5 changes: 5 additions & 0 deletions
5
...20190221171155_remove_deprecated_translatable_fields_from_legislation_question_options.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class RemoveDeprecatedTranslatableFieldsFromLegislationQuestionOptions < ActiveRecord::Migration[4.2] | ||
def change | ||
remove_column :legislation_question_options, :value, :string | ||
end | ||
end |
7 changes: 7 additions & 0 deletions
7
...ate/20190221171859_remove_deprecated_translatable_fields_from_site_customization_pages.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class RemoveDeprecatedTranslatableFieldsFromSiteCustomizationPages < ActiveRecord::Migration[4.2] | ||
def change | ||
remove_column :site_customization_pages, :title, :string | ||
remove_column :site_customization_pages, :subtitle, :string | ||
remove_column :site_customization_pages, :content, :text | ||
end | ||
end |
8 changes: 8 additions & 0 deletions
8
db/migrate/20190221172209_remove_deprecated_translatable_fields_from_widget_cards.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
class RemoveDeprecatedTranslatableFieldsFromWidgetCards < ActiveRecord::Migration[4.2] | ||
def change | ||
remove_column :widget_cards, :label, :string | ||
remove_column :widget_cards, :title, :string | ||
remove_column :widget_cards, :description, :text | ||
remove_column :widget_cards, :link_text, :string | ||
end | ||
end |
5 changes: 5 additions & 0 deletions
5
db/migrate/20190325184500_remove_deprecated_translatable_fields_from_budgets.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class RemoveDeprecatedTranslatableFieldsFromBudgets < ActiveRecord::Migration[4.2] | ||
def change | ||
remove_column :budgets, :name, :string | ||
end | ||
end |
5 changes: 5 additions & 0 deletions
5
db/migrate/20190325185046_remove_deprecated_translatable_fields_from_budget_groups.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class RemoveDeprecatedTranslatableFieldsFromBudgetGroups < ActiveRecord::Migration[4.2] | ||
def change | ||
remove_column :budget_groups, :name, :string | ||
end | ||
end |
5 changes: 5 additions & 0 deletions
5
db/migrate/20190325185405_remove_deprecated_translatable_fields_from_budget_headings.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class RemoveDeprecatedTranslatableFieldsFromBudgetHeadings < ActiveRecord::Migration[4.2] | ||
def change | ||
remove_column :budget_headings, :name, :string | ||
end | ||
end |
6 changes: 6 additions & 0 deletions
6
db/migrate/20190325185550_remove_deprecated_translatable_fields_from_budget_phases.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class RemoveDeprecatedTranslatableFieldsFromBudgetPhases < ActiveRecord::Migration[4.2] | ||
def change | ||
remove_column :budget_phases, :summary, :text | ||
remove_column :budget_phases, :description, :text | ||
end | ||
end |
Oops, something went wrong.