feat: add config migration
This commit is contained in:
parent
cf6e5354ec
commit
da0d25c040
4 changed files with 26 additions and 5 deletions
18
migrations/1620319260238-timezones.js
Normal file
18
migrations/1620319260238-timezones.js
Normal 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()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue