20201002094932_datetime_precision.rb 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class DatetimePrecision < ActiveRecord::Migration[5.2]
  3. # rubocop:disable Metrics/AbcSize
  4. def change
  5. # return if it's a new setup
  6. return if !Setting.exists?(name: 'system_init_done')
  7. change_column :active_job_locks, :updated_at, :datetime, limit: 3
  8. change_column :active_job_locks, :created_at, :datetime, limit: 3
  9. change_column :taskbars, :last_contact, :datetime, limit: 3, null: false
  10. change_column :delayed_jobs, :run_at, :datetime, limit: 3
  11. change_column :delayed_jobs, :locked_at, :datetime, limit: 3
  12. change_column :delayed_jobs, :failed_at, :datetime, limit: 3
  13. change_column :import_jobs, :started_at, :datetime, limit: 3
  14. change_column :import_jobs, :finished_at, :datetime, limit: 3
  15. change_column :sessions, :updated_at, :datetime, limit: 3, null: false
  16. change_column :sessions, :created_at, :datetime, limit: 3, null: false
  17. change_column :smime_certificates, :not_before_at, :datetime, limit: 3
  18. change_column :smime_certificates, :not_after_at, :datetime, limit: 3
  19. change_column :knowledge_bases, :created_at, :datetime, limit: 3, null: false
  20. change_column :knowledge_bases, :updated_at, :datetime, limit: 3, null: false
  21. change_column :knowledge_base_locales, :created_at, :datetime, limit: 3, null: false
  22. change_column :knowledge_base_locales, :updated_at, :datetime, limit: 3, null: false
  23. change_column :knowledge_base_translations, :created_at, :datetime, limit: 3, null: false
  24. change_column :knowledge_base_translations, :updated_at, :datetime, limit: 3, null: false
  25. change_column :knowledge_base_categories, :created_at, :datetime, limit: 3, null: false
  26. change_column :knowledge_base_categories, :updated_at, :datetime, limit: 3, null: false
  27. change_column :knowledge_base_category_translations, :created_at, :datetime, limit: 3, null: false
  28. change_column :knowledge_base_category_translations, :updated_at, :datetime, limit: 3, null: false
  29. change_column :knowledge_base_answers, :created_at, :datetime, limit: 3, null: false
  30. change_column :knowledge_base_answers, :updated_at, :datetime, limit: 3, null: false
  31. change_column :knowledge_base_answer_translations, :created_at, :datetime, limit: 3, null: false
  32. change_column :knowledge_base_answer_translations, :updated_at, :datetime, limit: 3, null: false
  33. change_column :knowledge_base_menu_items, :created_at, :datetime, limit: 3, null: false
  34. change_column :knowledge_base_menu_items, :updated_at, :datetime, limit: 3, null: false
  35. change_column :oauth_access_grants, :created_at, :datetime, limit: 3, null: false
  36. change_column :oauth_access_grants, :revoked_at, :datetime, limit: 3
  37. change_column :oauth_access_tokens, :created_at, :datetime, limit: 3, null: false
  38. change_column :oauth_access_tokens, :revoked_at, :datetime, limit: 3
  39. change_column :oauth_applications, :created_at, :datetime, limit: 3, null: false
  40. change_column :oauth_applications, :updated_at, :datetime, limit: 3, null: false
  41. end
  42. # rubocop:enable Metrics/AbcSize
  43. end