20190730093801_script_example.mjs 580 B

12345678910111213141516171819202122232425262728
  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. import runScript from '../scripts/example/script_for_migration.mjs'
  10. const tags = []
  11. const migrate = async client => {
  12. const { db } = client
  13. await runScript()
  14. }
  15. const rollback = async client => {
  16. const { db } = client
  17. }
  18. export default {
  19. tags,
  20. migrate,
  21. rollback,
  22. }