Skip to content

Commit

Permalink
migrate: add showBoard field to zabo schema
Browse files Browse the repository at this point in the history
  • Loading branch information
jinho-choi123 committed May 5, 2024
1 parent aba91e3 commit ea1867a
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions migrations/1714912017538-add_showBoard_field.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
require ('@babel/register');
require ('../config/env');

const {Zabo} = require('../src/db');

/**
* Make any changes you need to make to the database here
*/
async function up () {
// Write migration here
// eslint-disable-next-line no-restricted-syntax
for await (const zabo of Zabo.find()) {
zabo.showBoard = false;
await zabo.save ();
}
}

/**
* Make any changes that UNDO the up function side effects here (if possible)
*/
async function down () {
// Write migration here
}

module.exports = { up, down };

0 comments on commit ea1867a

Please sign in to comment.