Commit 11d3711bbf656edd02964ca5a265dffb79f3a50c

Authored by graphlemon
1 parent 47236648

graphlemon: auto-commit uncommitted changes for 63352d3f-796c-40b3-b63b-ef5efad7…

…d7f3-main-checkout-drift
Showing 1 changed file with 13 additions and 0 deletions
src/backend_server.py
... ... @@ -1000,6 +1000,19 @@ def _ensure_schema(conn):
1000 1000 ).fetchone()
1001 1001 if exists is None:
1002 1002 schema.create_schema(conn)
  1003 + # 2026-08-06 (real incident): create_schema() above only ever runs for a
  1004 + # BRAND NEW db file. Every schema.migrate_*() function is documented as
  1005 + # idempotent/safe-to-call-unconditionally (including against a fresh
  1006 + # create_schema()'d db, which already has whatever they'd add), but
  1007 + # nothing ever actually called them against an EXISTING, already-
  1008 + # populated database until now -- caught for real when this exact
  1009 + # process restarted against the live production db and every
  1010 + # GET /api/tasks/:id started 500ing with "no such column: parent_run_id"
  1011 + # (D's migrate_add_work_graph_fork_columns had shipped and been tested,
  1012 + # but never wired into the one code path that runs on every real
  1013 + # startup). Run all three every time, not just on first-ever creation.
  1014 + schema.migrate_expand_artifact_types(conn)
  1015 + schema.migrate_relax_org_node_constraints(conn) # also runs migrate_add_work_graph_fork_columns internally
1003 1016  
1004 1017  
1005 1018 class _Server(ThreadingHTTPServer):
... ...