emirotin / mongodb-migrations

A Node.js migration framework for MongoDB
MIT License
258 stars 70 forks source link

Migration file not created (yarn) #62

Open yojeek opened 5 years ago

yojeek commented 5 years ago

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 commented 5 years ago

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

KieronWiltshire commented 5 years ago

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

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

I made that instead :P