mongodb-migrations icon indicating copy to clipboard operation
mongodb-migrations copied to clipboard

Migration file not created (yarn)

Open yojeek opened this issue 7 years ago • 2 comments

I have following script in my package.json

"scripts": {
     // ...
    "migrate": "mm --config=config/migration.js"
  },

Config :

module.exports = {
  url: 'mongodb://localhost/some',
  directory: 'migrations'
}

After I run create command no migration file being created :

$ yarn migrate create SOME yarn run v1.9.4 $ mm --config=config/migration.js create SOME the server/replset/mongos options are deprecated, all their options are supported at the top level of the options object [poolSize,ssl,sslValidate,sslCA,sslCert,ciphers,ecdhCurve,sslKey,sslPass,sslCRL,autoReconnect,noDelay,keepAlive,connectTimeoutMS,family,socketTimeoutMS,reconnectTries,reconnectInterval,ha,haInterval,replicaSet,secondaryAcceptableLatencyMS,acceptableLatencyMS,connectWithNoPrimary,authSource,w,wtimeout,j,forceServerObjectId,serializeFunctions,ignoreUndefined,raw,bufferMaxEntries,readPreference,pkFactory,promiseLibrary,readConcern,maxStalenessSeconds,loggerLevel,logger,promoteValues,promoteBuffers,promoteLongs,domainsEnabled,keepAliveInitialDelay,checkServerIdentity,validateOptions,appname,auth] ✨ Done in 0.93s.

yojeek avatar Oct 02 '18 09:10 yojeek

Looks like order of parameters passed to CLI interface matters (it shouldn't imo)

This works :

yarn mm create SOME --config=config/migration.js

While this doesn't (runs migration instead) :

yarn mm --config=config/migration.js create SOME

yojeek avatar Oct 02 '18 10:10 yojeek

Well how can we fix this? because thats an issue for me.

EDIT: https://github.com/KieronWiltshire/node-mogront

I made that instead :P

KieronWiltshire avatar Dec 02 '18 17:12 KieronWiltshire