graphile / migrate

Opinionated SQL-powered productive roll-forward migration tool for PostgreSQL.
MIT License
751 stars 58 forks source link

Improve docs and flow of uncommit #30

Closed frankdugan3 closed 4 years ago

frankdugan3 commented 5 years ago

The docs on uncommit explain what it does, but not so much when it would be useful, especially given the warning. Perhaps that could be improved with something like:

This is is useful, e.g, when committing to separate branches before merging into master. When such a conflict occurs, uncommitting can allow merging the separate changes, then committing them together.

Also, checking the commit hash to detect conflicts caused by using uncommit and display a warning message with instructions on how to handle them would be really helpful:

Your last ${n} commits have been changed upstream. Run graphile-migrate migrate --force to re-run all migrations since ${lastGoodMigration}.

benjie commented 5 years ago

Additional note: I think we should only allow --force to re-run the very latest commit. More than that should require a reset. So ${n} shouldn't be needed.

benjie commented 4 years ago

I've addressed the docs but I've not made migrate --force deal with conflicts. Dealing with conflicts is a big topic and I don't want to add code to handle that right now. The temporary solution is to uncommit as many times as is necessary, and then to migrate.