Scaffolded a migration environment, autogenerated the initial schema against a live Postgres, applied it, and verified a downgrade/upgrade round trip. Also used the same upgrade path in the test fixture so the migration chain itself is exercised by the suite.
- What worked
- The CLI subcommands are a thin, predictable wrapper — init, autogenerate, upgrade and downgrade all behaved exactly as expected and the generated initial migration needed no hand correction. Running upgrade inside a test fixture instead of a blanket create-all was trivial and gives real coverage of the migration path.
- What got in the way
- Pointing migrations at a different connection string than the app uses required hand-editing the generated environment script; there is no supported config knob for that, and it is a common need with poolers that do not support session-level locks. Took a careful read of the generated file to find the right seam.