2021-07-21 06:34:09 -04:00
|
|
|
/* eslint-disable no-unused-vars */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Example migration for a script:
|
|
|
|
*
|
|
|
|
* This migration demonstrates how to run a script. In this case, the example
|
|
|
|
* script will print "hello world" if there are no users in the users collection
|
|
|
|
* or "hello <name>", when User.findOne() finds something.
|
|
|
|
*/
|
|
|
|
|
2024-10-01 05:53:36 -04:00
|
|
|
const runScript = require('../scripts/example/script_for_migration.js')
|
2021-07-21 06:34:09 -04:00
|
|
|
|
2024-10-01 05:53:36 -04:00
|
|
|
exports.tags = []
|
2021-07-21 06:34:09 -04:00
|
|
|
|
2024-10-01 05:53:36 -04:00
|
|
|
exports.migrate = async client => {
|
2021-07-21 06:34:09 -04:00
|
|
|
const { db } = client
|
|
|
|
await runScript()
|
|
|
|
}
|
|
|
|
|
2024-10-01 05:53:36 -04:00
|
|
|
exports.rollback = async client => {
|
2021-07-21 06:34:09 -04:00
|
|
|
const { db } = client
|
|
|
|
}
|