upgrade to the latest head (ie: all new migration files)
downgrade to the current main to make sure the downgrade scripts run
upgrade again to make sure the downgrade scripts left things in a sensible state
fail if there were any sql errors etc
as this just runs the whole branch's diff, this doesn't cover cases where an individual downgrade script is bad, but all when combined with the other downgrade scripts in that branch it works out ok (imagine if you have two versions in a PR, but the downgrade for both alembic versions only happens in the function for one of them).
But i think this is okay as a first step
next steps:
[ ] create a new task in the PR concourse job
fail concourse
[ ] maybe make a lil jinja template to format the output into a nice github comment?
if this script finds new migration files, it will
as this just runs the whole branch's diff, this doesn't cover cases where an individual downgrade script is bad, but all when combined with the other downgrade scripts in that branch it works out ok (imagine if you have two versions in a PR, but the downgrade for both alembic versions only happens in the function for one of them).
But i think this is okay as a first step
next steps: