fixup! Added validation to posts status column

This commit is contained in:
Daniel Lockyer 2022-05-10 16:44:33 +01:00
parent 66652b6ea9
commit ada0e7975b

View File

@ -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']);