2021-06-01 12:20:20 +00:00
|
|
|
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
2017-09-08 08:28:34 +00:00
|
|
|
class StoreConfigNameUpdateIssue428 < ActiveRecord::Migration[4.2]
|
2016-11-17 14:06:31 +00:00
|
|
|
def up
|
|
|
|
# return if it's a new setup
|
2020-08-03 08:35:43 +00:00
|
|
|
return if !Setting.exists?(name: 'system_init_done')
|
2018-10-09 06:17:41 +00:00
|
|
|
|
2016-11-17 14:06:31 +00:00
|
|
|
setting = Setting.find_by(name: 'storage')
|
2017-01-11 13:15:05 +00:00
|
|
|
return if !setting
|
2018-10-09 06:17:41 +00:00
|
|
|
|
2016-11-17 14:06:31 +00:00
|
|
|
setting.name = 'storage_provider'
|
|
|
|
setting.options = {
|
|
|
|
form: [
|
|
|
|
{
|
2018-12-19 17:31:51 +00:00
|
|
|
display: '',
|
|
|
|
null: true,
|
|
|
|
name: 'storage_provider',
|
|
|
|
tag: 'select',
|
2016-11-17 14:06:31 +00:00
|
|
|
tranlate: true,
|
2018-12-19 17:31:51 +00:00
|
|
|
options: {
|
|
|
|
'DB' => 'Database',
|
2016-11-17 14:06:31 +00:00
|
|
|
'File' => 'Filesystem',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
}
|
|
|
|
setting.preferences = {
|
2018-12-19 17:31:51 +00:00
|
|
|
controller: 'SettingsAreaStorageProvider',
|
2016-11-17 14:06:31 +00:00
|
|
|
online_service_disable: true,
|
2018-12-19 17:31:51 +00:00
|
|
|
permission: ['admin.system'],
|
2016-11-17 14:06:31 +00:00
|
|
|
}
|
|
|
|
setting.save!
|
|
|
|
end
|
|
|
|
end
|