Database
Manage DB
Browse collections and tables, and watch the CQRS timing pipeline.
Coursescourses
Physical course track, distance, elevation profile, and GPX navigation route file.
π‘
Operational Purpose & Edge Invariants
Defines the immutable physical track for an athletic competition. Distinct from an Event (which has a scheduled time and competitors) and CourseSplits (which are logical checkpoints along this course). Can be reused year over year or across multiple events.
Relational Connections (5)
β Belongs ToorganizationId
organizations βOwning organization.
β Belongs TocopiedFromCourseId
courses βSource template or previous edition course this course was copied from.
β Has ManycopiedFromCourseId
courses βDerived courses created by copying this course layout.
β Has ManycourseId
events βRaces running along this physical course.
β Has ManycourseId
courseSplits βCheckpoints and milestone splits defined along this course.
Table Columns & Types (8)
courses| Column | PostgreSQL Type | Constraints | Default | Documentation |
|---|---|---|---|---|
| id | uuid | NOT NULLPK | gen_random_uuid() | Unique course identifier. |
| organizationId | uuid | NOT NULLFK -> organizations.id | β | Owning organization. |
| name | text | NOT NULL | β | Course title (e.g. "Western States 100 Trail"). |
| distanceMeters | double precision | NOT NULL | β | Official measured course distance in meters. |
| elevationGainMeters | integer | nullable | β | Cumulative positive elevation gain in meters. |
| gpxRouteUrl | text | nullable | β | Public URL to the official GPX elevation route file. |
| copiedFromCourseId | uuid | nullableFK -> courses.idON DELETE SET NULL | β | Optional reference to the source course from which this course was cloned or derived. |
| createdAt | timestamp with time zone | NOT NULL | now() | Creation timestamp. |
Database Indexes (2)
| Index Name | Columns | Type | Query Performance Rationale |
|---|---|---|---|
| courses_org_idx | (organizationId) | INDEX | Accelerates course catalog browsing by organization. |
| courses_copied_from_idx | (copiedFromCourseId) | INDEX | Accelerates lookup of course copy hierarchies, templates, and provenance lineage. |