20210717101728_issue_3647_custom_object_attribute_integer.rb 554 B

123456789101112131415161718
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. class Issue3647CustomObjectAttributeInteger < ActiveRecord::Migration[6.0]
  3. def up
  4. return if !Setting.exists?(name: 'system_init_done')
  5. %i[min max].each do |attr|
  6. ObjectManager::Attribute
  7. .where(data_type: 'integer', editable: true)
  8. .each do |attribute|
  9. next if attribute.data_option[attr] <= 2_147_483_647
  10. attribute.data_option[attr] = 2_147_483_647
  11. attribute.save!(validate: false)
  12. end
  13. end
  14. end
  15. end