trabajo-afectivo/db/migrate/20210903072144_map_translation_time_fields.rb

23 lines
597 B
Ruby
Raw Permalink Normal View History

2022-01-01 13:38:12 +00:00
# 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