-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
migrate: add showBoard field to zabo schema
- Loading branch information
1 parent
aba91e3
commit ea1867a
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }; |