fix: save default advanced trigger settings in user config
This commit is contained in:
parent
5ed84b7cdb
commit
85b60028f4
1 changed files with 14 additions and 9 deletions
|
|
@ -1,14 +1,19 @@
|
||||||
const db = require('./db')
|
const { saveConfig } = require('../lib/new-settings-loader')
|
||||||
|
|
||||||
|
|
||||||
exports.up = function (next) {
|
exports.up = function (next) {
|
||||||
|
const triggersDefault = {
|
||||||
|
triggersConfig_expirationTime: 'Forever',
|
||||||
|
triggersConfig_automation: 'Automatic'
|
||||||
|
}
|
||||||
|
|
||||||
const sql2 = [`insert into user_config (type, data, valid, schema_version) values ('config', '{"config":{
|
return saveConfig(triggersDefault)
|
||||||
"triggersConfig_expirationTime": "Forever",
|
.then(() => next())
|
||||||
"triggersConfig_automation": "Automatic"
|
.catch(err => {
|
||||||
} }', true, 2)`]
|
if (err.message === 'lamassu-server is not configured') {
|
||||||
|
next()
|
||||||
db.multi(sql2, next)
|
}
|
||||||
|
console.log(err.message)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.down = function (next) {
|
exports.down = function (next) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue