2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-12-28 07:38:41 -05:00
|
|
|
class ReplaceBlockedSilenceTranslation < ActiveRecord::Migration[5.1]
|
|
|
|
def change
|
|
|
|
execute <<~SQL
|
2017-12-28 08:18:25 -05: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 07:38:41 -05:00
|
|
|
SQL
|
|
|
|
end
|
|
|
|
end
|