# Operations runbooks One-shot scripts and notes for operational fixes that aren't part of the normal app flow. Each file is dated so the chronology is obvious. Anything in this folder is **historical**. Don't re-run scripts here without reading them first — most assume a specific broken state and will fail or corrupt a healthy one. ## Inventory | Date | File | What it fixed | |------|------|---------------| | 2026-06-02 | [`2026-06-02-db-drift-reconcile.sql`](./2026-06-02-db-drift-reconcile.sql) | Reconciled CT 102 `tasks` DB after years of `drizzle-kit push` left the migration ledger empty. Created the two tables that had never made it in (`markdown_backlog_items`, `cursor_sync_mappings`) and stamped all 8 migrations as applied. | | 2026-06-05 | [`2026-06-05-db-drift-reconcile-oauth-tables.sql`](./2026-06-05-db-drift-reconcile-oauth-tables.sql) | Authentik / GitHub / Google SSO was 500'ing on the OAuth callback with `relation "accounts" does not exist`. The 2026-06-02 reconcile had stamped 0000 as applied without verifying every 0000 table existed. Idempotently created the auth-adjacent tables that the OAuth path touches (`accounts`, `sessions`, `verification_tokens`, `user_email_identities`, `workspace_invites`, `audit_log`, `agent_runs`) and backfilled `user_email_identities` from `users`. Did not touch the ledger. |