trabajo-afectivo/db/migrate/20210903072144_map_translation_time_fields.rb
2022-01-01 14:38:12 +01:00

22 lines
597 B
Ruby

# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
class MapTranslationTimeFields < ActiveRecord::Migration[6.0]
def change
# return if it's a new setup
return if !Setting.exists?(name: 'system_init_done')
connection.exec_update(<<-UPDATE_STATEMENT, 'SQL')
UPDATE translations
SET source='FORMAT_DATE'
WHERE source='date'
UPDATE_STATEMENT
connection.exec_update(<<-UPDATE_STATEMENT, 'SQL')
UPDATE translations
SET source='FORMAT_DATETIME'
WHERE source='timestamp'
UPDATE_STATEMENT
end
end