Is there a good tool for background migrations?

For example add temporarily nullable column to a large table, deploy new code which starts writing to the new column, in background populate that column for existing rows in batches and finally alter column to be mandatory non-nullable.

Another example of non-trivial schema management case is to make schema change after new version rollout completes: simple migration at the start of the container can't do that.

It must be a solved problem, but I didn't see a good tool for it which would allow expressing these imperative changes in a declarative way which can be comitted and reviewed and tested along the app code. It is always bunch of adhoc ugly scripts on a side and some hand waving deployment instructions.

I tend to prefer to hand-roll schema migrations... but I use grate[1] for the most part. That said, I've created similar tooling for different scenarios.

1. https://grate-devs.github.io/grate/

Pretty easy to setup/use in a dev environment as well... see docker-compose.yaml and run/dbup script.

https://github.com/tracker1/FastEndpoints-SqlJobQueues

[deleted]