Database

Manage DB

Browse collections and tables, and watch the CQRS timing pipeline.

← Overviewβ€’ParticipantsScored Competitor

Entrantsentrants

The scored competitive unit in a race (Bib #, Plate #, or Car #) and polymorphic participant data.

Table Columns & Types (18)

entrants
ColumnPostgreSQL TypeConstraintsDefaultDocumentation
iduuid
NOT NULLPK
gen_random_uuid()Unique entrant identifier.
eventIduuid
NOT NULLFK -> events.id
β€”Race event.
personIduuid
NOT NULLFK -> people.id
β€”Registered person.
competitorNumbertext
NOT NULLUnique with eventId
β€”Assigned bib number, bike plate, or car number.
rfidCodetext
nullable
β€”Transponder chip serial number.
statusentrantStatusEnum
NOT NULLEnum
'registered'Competitive lifecycle state (registered, checked_in, in_progress, finished, dnf, retired, dq, otl).
divisiontext
NOT NULL
β€”Scoring division (e.g. "Open M", "F40-49", "Pro Men DH").
participantDatajsonb (ParticipantData)
NOT NULLDiscriminated Union
β€”Polymorphic payload: SoloCompetitor, VehicleCrew, or RelayTeam.
emergencyContactPersonIduuid
nullableFK -> people.idON DELETE SET NULL
β€”Primary emergency contact person record.
emergencyContactRelationshiptext
nullable
β€”Relationship to competitor (e.g. Spouse, Parent, Friend, Coach).
emergencyContactIsOnSiteboolean
NOT NULL
falseWhether the emergency contact is physically on-site at the event.
scheduledStartTimetimestamp with time zone
nullable
β€”Wave or staggered departure target.
actualStartTimetimestamp with time zone
nullable
β€”Verified chip detection at start line.
droppedSplitIduuid
nullableFK -> courseSplits.id
β€”Checkpoint where competitor withdrew.
dropReasontext
nullable
β€”Drop cause: 'voluntary', 'medical', 'mechanical', 'missed_cutoff'.
dropLocationDescriptiontext
nullable
β€”Search and rescue narrative if retired on course between stations.
commentstext
nullable
β€”Steward or medical notes.
createdAttimestamp with time zone
NOT NULL
now()Creation timestamp.

PostgreSQL Enums (1)

enum "entrant_status"

ValueLabelDomain Meaning
'registered'RegisteredSigned up, bib/plate assigned.
'checked_in'Checked InVerified at venue, mandatory gear inspected.
'dns'Did Not StartWithdrew before crossing official start line.
'in_progress'In ProgressActive on course; past start line.
'finished'FinishedLegally 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'DisqualifiedSanctioned by race stewards for course cutting or rules violations.
'otl'Over Time LimitCut off by station departure threshold.

Polymorphic JSONB Schemas

Zod Discriminated Unions

SoloCompetitor

Standard competitor schema for running and solo cycling.

FieldTypeDescription
kind'solo_competitor'Discriminating literal key.
medicalNotesstring (optional)Critical allergies or medical conditions.
pacerNamestring (optional)Registered pacer.
tShirtSizestring (optional)Swag apparel size.

VehicleCrew

Multi-person motorsport or rally crew schema.

FieldTypeDescription
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.

FieldTypeDescription
kind'relay_team'Discriminating literal key.
teamNamestringOfficial squad name.
captainContact{ name, phone, email, address }Team captain contact.
membersArray<{ legNumber, name, phone }>Individual leg runners.

Database Indexes (4)

Index NameColumnsTypeQuery Performance Rationale
entrants_event_competitor_idx(eventId, competitorNumber)UNIQUEPrevents duplicate bib number assignments within the same race event.
entrants_transponder_idx(rfidCode)INDEXAccelerates high-frequency transponder antenna hit matching during chip read ingestion.
entrants_status_idx(eventId, status)INDEXOptimizes dashboard filtering for active runners vs drops/finishers.
entrants_emergency_contact_person_idx(emergencyContactPersonId)INDEXAccelerates instant emergency lookups and contact resolution during medical incidents.