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