2020-04-24 05:55:06 +00:00
|
|
|
class SettingWebsocketBackend < ActiveRecord::Migration[5.2]
|
|
|
|
def change
|
|
|
|
# return if it's a new setup
|
2020-08-03 08:35:43 +00:00
|
|
|
return if !Setting.exists?(name: 'system_init_done')
|
2020-04-24 05:55:06 +00:00
|
|
|
|
|
|
|
Setting.create_if_not_exists(
|
|
|
|
title: 'Websocket backend',
|
|
|
|
name: 'websocket_backend',
|
|
|
|
area: 'System::WebSocket',
|
|
|
|
description: 'Defines how to reach websocket server. "websocket" is default on production, "websocketPort" is for CI',
|
|
|
|
state: Rails.env.production? ? 'websocket' : 'websocketPort',
|
|
|
|
frontend: true
|
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|