migrate.js 602 B

1234567891011121314151617181920212223242526
  1. /**
  2. * Configuration file for migrate-mongo
  3. * @see https://github.com/seppevs/migrate-mongo
  4. *
  5. * @author Yuki Takei <yuki@weseek.co.jp>
  6. */
  7. require('module-alias/register');
  8. const { getMongoUri } = require('@commons/util/mongoose-utils');
  9. const mongoUri = getMongoUri();
  10. const match = mongoUri.match(/^(.+)\/([^/]+)$/);
  11. module.exports = {
  12. mongoUri,
  13. mongodb: {
  14. url: match[0],
  15. databaseName: match[2],
  16. options: {
  17. useNewUrlParser: true, // removes a deprecation warning when connecting
  18. },
  19. },
  20. migrationsDir: 'src/migrations/',
  21. changelogCollectionName: 'migrations',
  22. };