vapor / fluent

Vapor ORM (queries, models, and relations) for NoSQL and SQL databases
https://docs.vapor.codes/4.0/fluent/overview/
MIT License
1.3k stars 171 forks source link

Support reverting a migration on a specific database #764

Open grennis opened 1 year ago

grennis commented 1 year ago

Is your feature request related to a problem? Please describe. If I run migrate --revert, Fluent attempts to revert migrations on all attached databases. This is often not desired when migrations have been run independently on different databases over time.

Describe the solution you'd like Add an optional db parameter, like migrate --revert --db psql

Describe alternatives you've considered Maybe Fluent can check timestamps and only revert changes that were made together across databases, but this seems error prone.

Another option would be to query [Y/N] for the migration on each database instead of one [Y/N] prompt for all.

So currently I think the only way to support this is for the app developer to write a custom command.

Additional context N/A