2017-12-28 20:38:41 +08:00
|
|
|
class ReplaceBlockedSilenceTranslation < ActiveRecord::Migration[5.1]
|
|
|
|
def change
|
|
|
|
execute <<~SQL
|
2017-12-28 21:18:25 +08:00
|
|
|
UPDATE translation_overrides
|
|
|
|
SET translation_key = 'system_messages.silenced_by_staff.subject_template'
|
|
|
|
WHERE translation_key = 'system_messages.blocked_by_staff.subject_template'
|
|
|
|
AND NOT EXISTS (SELECT 1 FROM translation_overrides WHERE translation_key = 'system_messages.silenced_by_staff.subject_template');
|
|
|
|
SQL
|
|
|
|
|
|
|
|
execute <<~SQL
|
|
|
|
UPDATE translation_overrides
|
|
|
|
SET translation_key = 'system_messages.silenced_by_staff.text_body_template'
|
|
|
|
WHERE translation_key = 'system_messages.blocked_by_staff.text_body_template'
|
|
|
|
AND NOT EXISTS (SELECT 1 FROM translation_overrides WHERE translation_key = 'system_messages.silenced_by_staff.text_body_template');
|
2017-12-28 20:38:41 +08:00
|
|
|
SQL
|
|
|
|
end
|
|
|
|
end
|