20220920084800_setting_add_store_provider_s3.rb 1.1 KB

12345678910111213141516171819202122232425262728
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class SettingAddStoreProviderS3 < ActiveRecord::Migration[6.1]
  3. def change
  4. return if !Setting.exists?(name: 'system_init_done')
  5. storage_provider = Setting.find_by(name: 'storage_provider')
  6. storage_provider.description = '"Database" stores all attachments in the database (not recommended for storing large amounts of data). "Filesystem" stores the data in the filesystem. "Simple Storage (S3)" stores the data in a remote S3 compatible object filesystem. You can switch between the modules even on a system that is already in production without any loss of data.'
  7. storage_provider.options = {
  8. form: [
  9. {
  10. display: '',
  11. null: true,
  12. name: 'storage_provider',
  13. tag: 'select',
  14. options: {
  15. 'DB' => 'Database',
  16. 'File' => 'Filesystem',
  17. 'S3' => 'Simple Storage (S3)',
  18. },
  19. translate: true,
  20. },
  21. ],
  22. }
  23. storage_provider.save!
  24. end
  25. end