Database
Manage DB
Browse collections and tables, and watch the CQRS timing pipeline.
Entrantsentrants
The scored competitive unit in a race (Bib #, Plate #, or Car #) and polymorphic participant data.
π‘
Operational Purpose & Edge Invariants
The primary unit of competition and leaderboards. Links a Person to an Event. Supports polymorphic participant configurations: Solo Competitor, Vehicle Crew (driver + co-driver + car details), or Relay Team (squad members + leg assignments). Tracks bib/plate number, RFID chip code, wave start offsets, and drop status.
Relational Connections (7)
β Belongs ToeventId
events βEvent in which this entrant is competing.
β Belongs TopersonId
people βPerson who registered or captains this entry.
β Belongs TodroppedSplitId
courseSplits βCheckpoint where competitor dropped / DNF'd if applicable.
β Has ManyentrantId
scoredSplitTimes βChronological scored splits recorded for this entrant.
β Has ManyentrantId
timeAllowances βAuthorized time allowances or holds granted to this competitor.
β Belongs ToemergencyContactPersonId
people βDesignated emergency contact person (normalized 1:1 relation).
β Has ManyentrantId
entrantHistoricalProjections βEvent-specific materialized pacing projection and safety model.
Table Columns & Types (18)
entrants| Column | PostgreSQL Type | Constraints | Default | Documentation |
|---|---|---|---|---|
| id | uuid | NOT NULLPK | gen_random_uuid() | Unique entrant identifier. |
| eventId | uuid | NOT NULLFK -> events.id | β | Race event. |
| personId | uuid | NOT NULLFK -> people.id | β | Registered person. |
| competitorNumber | text | NOT NULLUnique with eventId | β | Assigned bib number, bike plate, or car number. |
| rfidCode | text | nullable | β | Transponder chip serial number. |
| status | entrantStatusEnum | NOT NULLEnum | 'registered' | Competitive lifecycle state (registered, checked_in, in_progress, finished, dnf, retired, dq, otl). |
| division | text | NOT NULL | β | Scoring division (e.g. "Open M", "F40-49", "Pro Men DH"). |
| participantData | jsonb (ParticipantData) | NOT NULLDiscriminated Union | β | Polymorphic payload: SoloCompetitor, VehicleCrew, or RelayTeam. |
| emergencyContactPersonId | uuid | nullableFK -> people.idON DELETE SET NULL | β | Primary emergency contact person record. |
| emergencyContactRelationship | text | nullable | β | Relationship to competitor (e.g. Spouse, Parent, Friend, Coach). |
| emergencyContactIsOnSite | boolean | NOT NULL | false | Whether the emergency contact is physically on-site at the event. |
| scheduledStartTime | timestamp with time zone | nullable | β | Wave or staggered departure target. |
| actualStartTime | timestamp with time zone | nullable | β | Verified chip detection at start line. |
| droppedSplitId | uuid | nullableFK -> courseSplits.id | β | Checkpoint where competitor withdrew. |
| dropReason | text | nullable | β | Drop cause: 'voluntary', 'medical', 'mechanical', 'missed_cutoff'. |
| dropLocationDescription | text | nullable | β | Search and rescue narrative if retired on course between stations. |
| comments | text | nullable | β | Steward or medical notes. |
| createdAt | timestamp with time zone | NOT NULL | now() | Creation timestamp. |
PostgreSQL Enums (1)
enum "entrant_status"
| Value | Label | Domain Meaning |
|---|---|---|
| 'registered' | Registered | Signed up, bib/plate assigned. |
| 'checked_in' | Checked In | Verified at venue, mandatory gear inspected. |
| 'dns' | Did Not Start | Withdrew before crossing official start line. |
| 'in_progress' | In Progress | Active on course; past start line. |
| 'finished' | Finished | Legally completed all required splits. |
| 'dnf' | Did Not Finish (In Custody) | Dropped at an official checkpoint and accounted for. |
| 'retired' | Retired On Course (SAR Alert) | Withdrew between checkpoints; search and rescue protocol initiated. |
| 'dq' | Disqualified | Sanctioned by race stewards for course cutting or rules violations. |
| 'otl' | Over Time Limit | Cut off by station departure threshold. |
Polymorphic JSONB Schemas
Zod Discriminated UnionsSoloCompetitor
Standard competitor schema for running and solo cycling.
| Field | Type | Description |
|---|---|---|
| kind | 'solo_competitor' | Discriminating literal key. |
| medicalNotes | string (optional) | Critical allergies or medical conditions. |
| pacerName | string (optional) | Registered pacer. |
| tShirtSize | string (optional) | Swag apparel size. |
VehicleCrew
Multi-person motorsport or rally crew schema.
| Field | Type | Description |
|---|---|---|
| kind | 'vehicle_crew' | Discriminating literal key. |
| driver | { name, licenseNumber, phone } | Primary pilot. |
| coDriver | { name, licenseNumber, phone } (optional) | Navigator / co-driver. |
| vehicle | { make, model, year, vehicleClass } | Vehicle classification and specifications. |
RelayTeam
Squad schema for Ekiden, multi-runner loops, and team relays.
| Field | Type | Description |
|---|---|---|
| kind | 'relay_team' | Discriminating literal key. |
| teamName | string | Official squad name. |
| captainContact | { name, phone, email, address } | Team captain contact. |
| members | Array<{ legNumber, name, phone }> | Individual leg runners. |
Database Indexes (4)
| Index Name | Columns | Type | Query Performance Rationale |
|---|---|---|---|
| entrants_event_competitor_idx | (eventId, competitorNumber) | UNIQUE | Prevents duplicate bib number assignments within the same race event. |
| entrants_transponder_idx | (rfidCode) | INDEX | Accelerates high-frequency transponder antenna hit matching during chip read ingestion. |
| entrants_status_idx | (eventId, status) | INDEX | Optimizes dashboard filtering for active runners vs drops/finishers. |
| entrants_emergency_contact_person_idx | (emergencyContactPersonId) | INDEX | Accelerates instant emergency lookups and contact resolution during medical incidents. |