20210903072144_map_translation_time_fields.rb 597 B

12345678910111213141516171819202122
  1. # Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
  2. class MapTranslationTimeFields < ActiveRecord::Migration[6.0]
  3. def change
  4. # return if it's a new setup
  5. return if !Setting.exists?(name: 'system_init_done')
  6. connection.exec_update(<<-UPDATE_STATEMENT, 'SQL')
  7. UPDATE translations
  8. SET source='FORMAT_DATE'
  9. WHERE source='date'
  10. UPDATE_STATEMENT
  11. connection.exec_update(<<-UPDATE_STATEMENT, 'SQL')
  12. UPDATE translations
  13. SET source='FORMAT_DATETIME'
  14. WHERE source='timestamp'
  15. UPDATE_STATEMENT
  16. end
  17. end