jackc / tern

The SQL Fan's Migrator
MIT License
850 stars 66 forks source link

rollback using helm ends with an error if "last" is used #96

Open antonyc opened 3 months ago

antonyc commented 3 months ago

Hi! Thanks for the great tool. We're started using tern with a k8s job that is recreated with each new helm release. That also means that a previous version of the job is created with each helm rollback. For simplicity we run tern with "last" destination. That greatly simplifies experience.

This piece of code is causing problems with rollback. https://github.com/jackc/tern/blob/22a33fd044cac3cde941b109580223c073c6302b/migrate/migrate.go#L303-L306

I suggest having a CLI argument to turn this control off if flag is set. WDYT?

jackc commented 2 months ago

Sorry, I'm not sure I understand. The problem is last as a destination doesn't work under what conditions?