mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
fixup! Added validation to posts status column
This commit is contained in:
parent
66652b6ea9
commit
ada0e7975b
1 changed files with 2 additions and 0 deletions
|
@ -3,6 +3,8 @@ const {createTransactionalMigration} = require('../../utils');
|
|||
|
||||
module.exports = createTransactionalMigration(
|
||||
async function up(knex) {
|
||||
logging.info(`Updating posts with invalid statuses to 'draft'`);
|
||||
|
||||
const affectedRows = await knex('posts')
|
||||
.update('status', 'draft')
|
||||
.whereNotIn('status', ['published', 'draft', 'scheduled', 'sent']);
|
||||
|
|
Loading…
Add table
Reference in a new issue