20231024103209_issue_4838_data_retention.rb 553 B

123456789101112131415161718
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class Issue4838DataRetention < ActiveRecord::Migration[7.0]
  3. def change
  4. # return if it's a new setup
  5. return if !Setting.exists?(name: 'system_init_done')
  6. add_column :jobs, :object, :string, limit: 100, null: true # optional for now
  7. Job.reset_column_information
  8. Job.update_all(object: 'Ticket') # rubocop:disable Rails/SkipsModelValidations
  9. change_column :jobs, :object, :string, limit: 100, null: false
  10. Job.reset_column_information
  11. end
  12. end