fix: deploy-time schema gate used a sync driver not guaranteed to exist
schema_gate.py (run during every deploy, see deploy/deploy.sh step 2) built its own sync create_engine() against a '+asyncpg'-stripped DATABASE_URL, relying on SQLAlchemy's default postgresql dialect resolution to land on psycopg2. On the current runtime image that resolution instead picked the psycopg (v3) dialect, whose package isn't installed (requirements.txt only has psycopg2-binary) -- ModuleNotFoundError: No module named 'psycopg', hard-blocking every deploy. This had been latent for a month: the last staging deploy predates this file by enough that it was never actually exercised until today.
alembic/env.py already solved exactly this problem for actual migrations: create_async_engine() against the full asyncpg URL, then connection.run_sync() to bridge into Alembic's sync-style API. schema_gate needed the identical bridge for compare_metadata -- it was just missing.
Verified locally against the running musehub_postgres container: passes clean (73 tables in sync) and correctly fails when a real drift column is added, confirming the gate still catches genuine ORM/migration drift, not just a driver import that no longer throws.
Semantic Changes
3 symbols
Files Changed
~1
1084 in snapshot
0 comments
muse hub commit comment sha256:1a5904eb08c0aa4a4e633dc07272300d69dd2502f45a2534e1028d960e24783c --body "your comment"
No comments yet. Be the first to start the discussion.