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-02 05:32:13 -04:00
|
|
|
import runScript from '../scripts/example/script_for_migration.js'
|
2021-07-21 06:34:09 -04:00
|
|
|
|
2024-10-02 05:32:13 -04:00
|
|
|
const tags = []
|
2021-07-21 06:34:09 -04:00
|
|
|
|
2024-10-02 05:32:13 -04:00
|
|
|
const migrate = async client => {
|
2021-07-21 06:34:09 -04:00
|
|
|
const { db } = client
|
|
|
|
await runScript()
|
|
|
|
}
|
|
|
|
|
2024-10-02 05:32:13 -04:00
|
|
|
const rollback = async client => {
|
2021-07-21 06:34:09 -04:00
|
|
|
const { db } = client
|
|
|
|
}
|
2024-10-02 05:32:13 -04:00
|
|
|
|
|
|
|
export default {
|
|
|
|
tags,
|
|
|
|
migrate,
|
|
|
|
rollback,
|
|
|
|
}
|