rubenv / sql-migrate

SQL schema migration tool for Go.
MIT License
3.19k stars 273 forks source link

Add skip command to support versioning pre-existing db's #100

Closed stephen-kruger closed 6 years ago

stephen-kruger commented 6 years ago

Add support for a "skip" command which will process all .sql migration files as no-operations, but still write the schema table version with the last found version.

This provides a way to apply sql-migrate versioning to pre-existing databases where you don't necessarily want to run from the initial schema file, but from some later point.

Supports all the same flags and options as the Up command.

rubenv commented 6 years ago

Cool, that makes sense.

Could you delete the commented (unneeded) code?

stephen-kruger commented 6 years ago

Absolutely, apologies for leaving it in - I'll lean the code up and commit a final version.

rubenv commented 6 years ago

Looks excellent, thanks a lot!

I hope sql-migrate serves well @grab, happy to make things easier!