afloyd / mongo-migrate

MIT License
159 stars 81 forks source link

Ignore subdirectories when looking for migrations #54

Closed siboulet closed 7 years ago

siboulet commented 8 years ago

mongo-migrate reads content of the "migrations" directory when looking for migrations file. It compares anything found in the migrations directory looking for files that match *.js: https://github.com/afloyd/mongo-migrate/blob/master/index.js#L139

This include comparing subdirectories names.

For example creating a "data" directory to hold json or xml files needed for migrations yields the following warning when running mongo-migrate:

"data" ignored. Does not match migration naming schema

To avoid this warning the data directory needs to be placed outside the migrations directory.