mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 14:03:48 +03:00
Added a down() operation to newsletters
- Without the down operation, the previous migration fails to re-add the created_at column after a rollback
This commit is contained in:
parent
69f31074e0
commit
2d27c9d42a
@ -35,7 +35,7 @@ module.exports = createTransactionalMigration(
|
||||
const newsletters = await knex('newsletters').count('*', {as: 'total'});
|
||||
|
||||
if (newsletters[0].total !== 0) {
|
||||
logging.info('Skipping adding the default newsletter - There is already at least one newsletter');
|
||||
logging.warn('Skipping adding the default newsletter - There is already at least one newsletter');
|
||||
return;
|
||||
}
|
||||
|
||||
@ -76,9 +76,8 @@ module.exports = createTransactionalMigration(
|
||||
logging.info('Adding the default newsletter');
|
||||
await knex('newsletters').insert(newsletter);
|
||||
},
|
||||
async function down() {
|
||||
// Noop because we don't want to reset the default newsletter values
|
||||
logging.info(`Skipping newsletter design settings backfill rollback - not needed`);
|
||||
return Promise.resolve();
|
||||
async function down(knex) {
|
||||
logging.info(`Removing newsletters`);
|
||||
await knex('newsletters').delete();
|
||||
}
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user