I'm assuming you'll also need this script/change to go through QA and staging before it reaches Prod. The only tool I found, short of daisy chaining a bunch of GitHub actions, that does this is RedGate Deploy.
Curious to learn how y'all are achieving this today.
You can further check out this tutorial to get a feel of our GitOps solution
https://www.bytebase.com/docs/tutorials/database-change-mana...
What we are not good about is making sure the changelogs have revert capability... some devs do it right and others not so much
I’m not sure anything more complex is needed. I tried using Liquibase at some point and it was a nightmare compared to just using SQL.
So ours is pytest that builds up a fake database + tables to unit test the scripts. And otherwise it is the normal review process for pull requests.
So ours is daisy chained as well, but I am quite happy with it.
(Though I don't think it is "complete" or "perfect", either.)
EF Migrations are in a really good place now if you like/don't mind C# as a language (and you can easily embed SQL inside the C#, too, but there are benefits to being able to also run high level C# code). With today's tooling you can package your migration "runner application" as a single deployable executable for most platforms. You can build the executable once and run it in all your environments. (The same tool that updates your QA and Staging updates your Prod, testably running the same migrations.) Given the single executable deployable I might even consider using it for projects not themselves written in C#.
We use GitHub actions for deployment and database migrations are just one step of the pipeline. The step invokes sqitch deploy which runs all the pending migration files.
Then, all the approval process is standard for the environment. We require approvals in pull requests before merging to the main branch.
We commit schema file alongside the rest of the code, and it gets applied as part of the CI run to our dev and QA/test DBs.
So not a direct answer I suppose, but it really cuts down on what you need to do manually against the DB.
Active Record is a Ruby library that provides ORM support in Ruby on Rails, and includes an elegant way for creating reversible migrations.
Capistrano allows you to configure and run tasks on a remote server, such as pulling the latest version of code from the git repo and running the newest migrations.
Another is migrations as code using an ORM library.
Last gig was doing that and diff’ing sql schema and bootstrap files, depending on the db. We eventually turned them into one time docker containers which actually made life easy
If it is for a CMS / Web based thing that modifies the structure of the database or inserts some seed data - Use Migrations
If it is for some ETL type job where you are using SQL then migrating to a tool like DBT is probably wise.
The key here is to put _everything_ into a 100% replayable transaction log, which is what said combination does.