Closed chris-aeviator closed 4 years ago
re-reading the example again I can confirm that an additional mongoDB connection in the models/index.js
is required. After adding the required mongoose.connect('mongodb://localhost:27017/myDatabaseName', { useNewUrlParser: true })
, everything works like expected
When setting up migrate-mongoose with a working mongo:// db connection and running
migrate up
the command will be issued (I can see that it is picking up my migration file by introducing an error into my JS code) but will never get past the point of "Synchronizing database with file system migrations".This might be related to https://github.com/balmasi/migrate-mongoose/issues/6 , but I can see the migrate skript connect to mongo in mongo's logs, I can also see a migration appearing in my DB in the migrations table, it's state stays 'DOWN'.
When running the command with a
DEBUG=*
prepended, the only thing logged after Synchronizing... ismquery findOne migrations {} { sort: { createdAt: -1 }, projection: {} } +0ms