Files
nairobi/db/migrate/20190213150434_rename_old_translatable_attibutes_in_debates.rb
Javi Martín 7a78776569 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 251326ea.
2019-11-07 22:01:43 +01:00

9 lines
255 B
Ruby

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