20161117000003_store_config_name_update_issue_428.rb 885 B

12345678910111213141516171819202122232425262728293031323334
  1. # Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
  2. class StoreConfigNameUpdateIssue428 < ActiveRecord::Migration[4.2]
  3. def up
  4. # return if it's a new setup
  5. return if !Setting.exists?(name: 'system_init_done')
  6. setting = Setting.find_by(name: 'storage')
  7. return if !setting
  8. setting.name = 'storage_provider'
  9. setting.options = {
  10. form: [
  11. {
  12. display: '',
  13. null: true,
  14. name: 'storage_provider',
  15. tag: 'select',
  16. tranlate: true,
  17. options: {
  18. 'DB' => 'Database',
  19. 'File' => 'Filesystem',
  20. },
  21. },
  22. ],
  23. }
  24. setting.preferences = {
  25. controller: 'SettingsAreaStorageProvider',
  26. online_service_disable: true,
  27. permission: ['admin.system'],
  28. }
  29. setting.save!
  30. end
  31. end