fix: No data returned from the query errors on migration
This commit is contained in:
parent
bb440eedd6
commit
ea9a373676
2 changed files with 2 additions and 2 deletions
|
|
@ -92,7 +92,7 @@ function loadLatestConfig (filterSchemaVersion = true) {
|
||||||
order by id desc
|
order by id desc
|
||||||
limit 1`
|
limit 1`
|
||||||
|
|
||||||
return db.one(sql, ['config', configValidate.SETTINGS_LOADER_SCHEMA_VERSION])
|
return db.oneOrNone(sql, ['config', configValidate.SETTINGS_LOADER_SCHEMA_VERSION])
|
||||||
.then(row => row.data.config)
|
.then(row => row.data.config)
|
||||||
.then(configValidate.validate)
|
.then(configValidate.validate)
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
|
|
|
||||||
|
|
@ -167,7 +167,7 @@ function loadLatestConfig () {
|
||||||
ORDER BY id DESC
|
ORDER BY id DESC
|
||||||
LIMIT 1`
|
LIMIT 1`
|
||||||
|
|
||||||
return db.one(sql, [NEW_SETTINGS_LOADER_SCHEMA_VERSION])
|
return db.oneOrNone(sql, [NEW_SETTINGS_LOADER_SCHEMA_VERSION])
|
||||||
.then(row => row ? row.data.config : {})
|
.then(row => row ? row.data.config : {})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
throw err
|
throw err
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue