You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The SQLite schema is defined inline in src/server/store.ts and the Supabase schema is split across multiple migration files. There is no unified reference document describing:
What tables exist
What each column stores
How tables relate to each other
Why specific design decisions were made
Solution
Create docs/database-schema.md:
SQLite (Local — ~/.chainreview/chainreview.db)
Document each table:
### `runs`
Stores each review run.
| Column | Type | Description ||--------|------|-------------|| id | TEXT | UUID, primary key || repo_root | TEXT | Absolute path to repository root || status | TEXT | queued \| running \| complete \| failed || started_at | INTEGER | Unix timestamp || completed_at | INTEGER | Unix timestamp, null if not done |
| ...
### `findings`
Individual findings from agent analysis.
### `chat_messages`
Chat Q&A messages per run.
### `patch_applications`
Record of applied patches.
Priority: P3 — Low
Problem
The SQLite schema is defined inline in
src/server/store.tsand the Supabase schema is split across multiple migration files. There is no unified reference document describing:Solution
Create
docs/database-schema.md:SQLite (Local —
~/.chainreview/chainreview.db)Document each table:
Supabase (Cloud — PostgreSQL)
Document tables from
supabase/migrations/:profiles— user accountsapi_keys— per-user API keysusage— request/token trackingsubscriptions— Stripe subscription recordsMermaid ER Diagram
erDiagram runs ||--o{ findings : "has" runs ||--o{ chat_messages : "has" findings ||--o{ patch_applications : "has"Acceptance Criteria
docs/database-schema.mddocuments all SQLite tablesDEVELOPMENT.md