Skip to content

Commit

Permalink
feat: add migration to automatically enable old services
Browse files Browse the repository at this point in the history
  • Loading branch information
chaotixkilla committed Sep 22, 2022
1 parent 728eb3b commit 8de8605
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions migrations/1663862352999-add-services-toggle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const _ = require('lodash/fp')
const { saveAccounts, loadLatest } = require('../lib/new-settings-loader')

exports.up = function (next) {
loadLatest()
.then(({ accounts }) => saveAccounts(_.mapValues(it => ({ ...it, enabled: true }), _.cloneDeep(accounts))))
.then(() => next())
.catch(err => {
console.log(err.message)
return next(err)
})
}

exports.down = function (next) {
next()
}

0 comments on commit 8de8605

Please sign in to comment.