20240314105755_group_max_level_extension.rb 554 B

1234567891011121314
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class GroupMaxLevelExtension < 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. return if ActiveRecord::Base.connection_db_config.configuration_hash[:adapter] == 'mysql2'
  7. groups_name_limit = (160 * 10) + (2 * 9) # max depth of 10 and 9 delimiters in between
  8. change_column :groups, :name, :string, limit: groups_name_limit, null: false
  9. Group.reset_column_information
  10. end
  11. end