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