20190730093801_script_example.js 539 B

12345678910111213141516171819202122
  1. /* eslint-disable no-unused-vars */
  2. /*
  3. * Example migration for a script:
  4. *
  5. * This migration demonstrates how to run a script. In this case, the example
  6. * script will print "hello world" if there are no users in the users collection
  7. * or "hello <name>", when User.findOne() finds something.
  8. */
  9. const runScript = require('../scripts/example/script_for_migration.js')
  10. exports.tags = []
  11. exports.migrate = async client => {
  12. const { db } = client
  13. await runScript()
  14. }
  15. exports.rollback = async client => {
  16. const { db } = client
  17. }