From 10ff5ba3ab7ec9811164cb9f93414f8cbd43c771 Mon Sep 17 00:00:00 2001 From: Tarik Moussa Date: Mon, 15 Jun 2026 15:54:25 +0200 Subject: [PATCH] chore(infra): point migration helper preflight at 'codex migrate' Now that 'codex migrate' applies the idempotent schema via a privileged role, recommend it (with MIGRATION_DATABASE_URL) as the primary schema-sync fix in the preflight abort message, keeping the manual owner-ALTER as a fallback. Co-Authored-By: Claude Fable 5 --- infra/reingest_canonical_ids.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/infra/reingest_canonical_ids.sh b/infra/reingest_canonical_ids.sh index 600ade3..213862c 100755 --- a/infra/reingest_canonical_ids.sh +++ b/infra/reingest_canonical_ids.sh @@ -76,11 +76,13 @@ PYEOF )" if [[ "$SECTION_OK" != "yes" ]]; then echo "ABORT — schema not ready: chunks.section is missing (audit M-1)." - echo "The app user cannot add it (chunks is owned by 'postgres'). Apply it as" - echo "the table owner, then re-run this script:" + echo "The app user cannot add it (core tables are owned by 'postgres'). Sync the" + echo "schema with a privileged role, then re-run this script. Either:" echo "" - echo " ssh alfred@192.168.178.103 \\" - echo " \"sudo -u postgres psql -d papers -c \\\\\"ALTER TABLE chunks ADD COLUMN IF NOT EXISTS section TEXT;\\\\\"\"" + echo " (a) MIGRATION_DATABASE_URL=postgresql://postgres:PASS@HOST:PORT/papers \\" + echo " \"$CODEX_DIR/.venv/bin/codex\" migrate # applies schema.sql idempotently" + echo " (b) sudo -u postgres psql -d papers \\" + echo " -c \"ALTER TABLE chunks ADD COLUMN IF NOT EXISTS section TEXT;\"" echo "" echo "Nothing was changed — no TRUNCATE was issued." exit 1