Emi Matchu
73af9d4d77
Like in 0dca538
, this is preliminary work for being able to drop the
`zone_translations` table! We're copying the field over first, to be
able to migrate DTI 2020 safely before dropping anything.
16 lines
482 B
Ruby
16 lines
482 B
Ruby
class AddLabelAndPlainLabelToZones < ActiveRecord::Migration[7.1]
|
|
def change
|
|
add_column :zones, :label, :string, null: false
|
|
add_column :zones, :plain_label, :string, null: false
|
|
|
|
reversible do |direction|
|
|
direction.up do
|
|
Zone.includes(:translations).find_each do |zone|
|
|
zone.label = zone.translation_for(:en).label
|
|
zone.plain_label = zone.translation_for(:en).plain_label
|
|
zone.save!
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|