personal_records table
The personal_records table in the Cord Powell Hot Dog Tracker schema has 7 columns, keyed by id, with 2 foreign keys to eaters and sessions.
CACHE, not source of truth -- every row here is derivable from session_dogs. It exists so the leaderboard does not re-scan the full history on every page load. Recompute on session completion AND on any status change to a reversal, or records go stale in the one direction nobody thinks to check. Rows exist for rivals too, so "Cord vs the field" is one query against one table.
Columns (7)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| eater_id | uuid | not null, references eaters.id | |
| kind | record_kind | not null | |
| value | numeric(8,2) | not null | Units depend on kind -- see the record_kind enum. fastest_10 is seconds, where lower wins. |
| session_id | uuid | references sessions.id | The run that set it. Keeps the record auditable. |
| achieved_at | timestamptz | not null | |
| updated_at | timestamptz | not null |
Indexes (2)
(eater_id, kind)unique(kind)
Relationships
personal_records.eater_idreferenceseaters.idpersonal_records.session_idreferencessessions.id