Optional DDL used bare try/except, which left the migration txn aborted so alembic_version never stamped and config-sync APIs failed. Run best-effort statements inside SAVEPOINTs.
Co-authored-by: Cursor <cursoragent@cursor.com>
Extract shared brownfield patches, add the legacy revision, and default to upgrade-head plus skip of duplicate inline DDL (with legacy fallback if Alembic fails).
Co-authored-by: Cursor <cursoragent@cursor.com>