trabajo-afectivo/db/migrate/20211118081558_maintenance_improve_sipgate_integration_handling.rb

30 lines
816 B
Ruby
Raw Permalink Normal View History

2022-01-03 09:50:12 +00:00
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
class MaintenanceImproveSipgateIntegrationHandling < ActiveRecord::Migration[6.0]
def change
return if !Setting.exists?(name: 'system_init_done')
Setting.create_if_not_exists(
2022-01-03 09:50:12 +00:00
title: 'sipgate.io Token',
name: 'sipgate_token',
area: 'Integration::Sipgate',
2022-01-03 09:50:12 +00:00
description: 'Token for Sipgate.',
options: {
form: [
{
display: '',
null: false,
name: 'sipgate_token',
tag: 'input',
},
],
},
state: ENV['SIPGATE_TOKEN'] || SecureRandom.urlsafe_base64(20),
preferences: {
permission: ['admin.integration'],
},
frontend: false
)
end
end