mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-27 22:49:56 -05:00
Added migration for session verification field
This commit is contained in:
parent
296a2be2d8
commit
58269c879b
1 changed files with 25 additions and 0 deletions
|
@ -0,0 +1,25 @@
|
|||
const logging = require('@tryghost/logging');
|
||||
|
||||
const {createTransactionalMigration} = require('../../utils');
|
||||
|
||||
module.exports = createTransactionalMigration(
|
||||
async function up(knex) {
|
||||
logging.info('Adding verified property to sessions');
|
||||
|
||||
await knex.raw(`
|
||||
UPDATE sessions
|
||||
SET session_data = JSON_SET(session_data, '$.verified', 'true')
|
||||
WHERE JSON_VALID(session_data);
|
||||
`);
|
||||
},
|
||||
|
||||
async function down(knex) {
|
||||
logging.info('Removing verified property from sessions');
|
||||
|
||||
await knex.raw(`
|
||||
UPDATE sessions
|
||||
SET session_data = JSON_REMOVE(session_data, '$.verified')
|
||||
WHERE JSON_VALID(session_data);
|
||||
`);
|
||||
}
|
||||
);
|
Loading…
Add table
Reference in a new issue