I resented writing the verify scripts for my migrations, after writing unit and integration tests, but yes it is valuable
Re:Ask HN: How do you test SQL?
by grilledcheez on Wednesday February 01, 2023 @05:05AM
(#34608526)
At my job, we're breaking down a monolith into services with a hand-me-down database schema. DB changes are manual, every dev runs against a shared test DB, and everybody dreads doing schema changes. I've been looking for a way to transition into version controlled migrations and it looks like sqitch might be a solid option, as the language-specific frameworks are too opinionated. Thanks for recommending!
You're very welcome!
FWIW there are other general migration frameworks worth considering; the two most popular seem to be Flyway and Liquibase. I've heard good things about both, and don't have a particularly strong defense for my sqitch preference. I like that it's simple, has great docs, and has verification as a natural step in the workflow.
We built a GUI based solution called https://github.com/bytebase/bytebase. You may also take a look.
¹: https://sqitch.org/