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:
parent
d254a697b9
commit
47843bbfe9
1 changed files with 5 additions and 7 deletions
|
@ -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
|
||||
}
|
||||
};
|
||||
);
|
||||
|
|
Loading…
Add table
Reference in a new issue