0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-04-01 02:41:39 -05:00

Refactored migration to use transactional utility

This commit is contained in:
Naz 2021-02-03 12:12:31 +13:00 committed by naz
parent d254a697b9
commit 47843bbfe9

View file

@ -1,10 +1,8 @@
const {createTransactionalMigration} = require('../../utils');
const logging = require('../../../../../shared/logging');
module.exports = {
config: {
transaction: true
},
async up({transacting: knex}){
module.exports = createTransactionalMigration(
async function up(knex){
const settingsKeys = ['installed_apps', 'active_apps'];
logging.info(`Removing ${settingsKeys.join(',')} from "settings" table.`);
@ -12,7 +10,7 @@ module.exports = {
.whereIn('key', settingsKeys)
.del();
},
async down() {
async function down() {
// noop: no need to recreate any apps as it's a cleanup in major version migration
}
};
);