feat: add config migration

This commit is contained in:
Sérgio Salgado 2021-05-06 19:09:36 +01:00 committed by Josh Harvey
parent cf6e5354ec
commit da0d25c040
4 changed files with 26 additions and 5 deletions

View file

@ -0,0 +1,18 @@
const _ = require('lodash/fp')
const settingsLoader = require('../lib/new-settings-loader')
exports.up = function (next) {
settingsLoader.loadLatest()
.then(({ config }) => {
if (!_.isEmpty(config))
config.locale.timezone = '0:0'
return settingsLoader.saveConfig(config)
})
.then(() => next())
.catch(err => next(err))
}
exports.down = function (next) {
next()
}