Files
loki/scripts
GandClaude Opus 4.8 c545da37b5 feat(devops): verify box DB schema on every prod deploy (#21)
The pre-push schema-drift guard (#16) runs against the LAPTOP database, but the
Hetzner box has its own Postgres — so a table added in code but never pushed to
the box would silently 500 the first feature that queries it on prod (the same
failure that took down /prompts, /loki and System cron locally). deploy-hetzner
had no schema step at all.

- check-schema-drift.ts gains a `--print` mode: emit the schema-declared table
  names (no DB needed) so a remote deploy can compare against a database the
  laptop can't reach directly.
- deploy-hetzner.sh post-deploy verification now prints the declared tables,
  fetches the box's public tables over ssh (box reads its own DATABASE_URL),
  diffs them, and fails LOUDLY listing any missing — telling the operator to run
  drizzle-kit push rather than trusting a half-broken deploy.

Verified on a live deploy: "✓ schema: all 45 declared tables present on box".

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 18:01:21 +02:00
..