seppevs / migrate-mongo

A database migration tool for MongoDB in Node
MIT License
927 stars 163 forks source link

Command to run single file migrations script #296

Open shpetimselaci opened 3 years ago

shpetimselaci commented 3 years ago

Is your feature request related to a problem? Please describe. We're using the tool to run our migrations in our MongoDB database. Right now, it only runs all the migrations scrips under migrations folder We want to run a migration from a single file that we recently wrote.

Describe the solution you'd like It would be nice if we could have a command like this:

migrate-mongo [up|down] --migration-file 'migrations/your-migration-file.js' It would use the default config you've already set, or have a argument for that as well in this line like so:

migrate-mongo [up|down] --migration-file 'migrations/your-migration-file.js' --config 'my-config-file.js' Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

shpetimselaci commented 3 years ago

Let me know if you want me to help you on this. I'm desperate.

ghost commented 3 years ago

Hello,

I implemented it here. https://github.com/ftreguer/migrate-mongo/pull/1

I forked another forked branch so it needs to be merged before mine.

Travis build currently fails for the same reason, because the Pull Request is located on the repo where it was first forked, so Travis is not well configured. When I will target main repo, it will be valid.

I ensured a 100% coverage.

shpetimselaci commented 3 years ago

Nice!

mastery-amit-sahani commented 3 years ago

Anytime soon this feature would be added? 😁

prof-alazhary commented 2 years ago

any updates guys?

wyardley commented 2 years ago

https://github.com/seppevs/migrate-mongo/pull/251 would also seem to accomplish this, more or less, right?

stascnb commented 2 years ago

@seppevs thumbs up