Right now when a webserver PR merges, two workflows trigger:
fractal-build-and-deploy
database-migration-push
The former redeploys the webserver with the new code, the latter applies new schema at main-webserver/db_migration/schema.sql to the live db. This leads to the following possibility:
webserver is doing a db operation
the schema gets changed, but the corresponding webserver ORM is not updated
the operation in 1) errors out because the ORM does not match the schema
the webserver redeploys, and now has an in-sycn ORM
A manifestation of this issue (the user_containers.lock column was deleted):
We fix this by tying our webserver redeploys to db migrations. The migration must be performed after the webserver is (briefly) taken down and before it is redeployed with the new code (including new ORM).
Bug Description See https://tryfractal.slack.com/archives/C013GT6T86R/p1617214816077000. Summary:
Right now when a webserver PR merges, two workflows trigger:
The former redeploys the webserver with the new code, the latter applies new schema at
main-webserver/db_migration/schema.sql
to the live db. This leads to the following possibility:A manifestation of this issue (the user_containers.lock column was deleted):
We fix this by tying our webserver redeploys to db migrations. The migration must be performed after the webserver is (briefly) taken down and before it is redeployed with the new code (including new ORM).