- races table: name, date, description, is_active
- stations table: ordered checkpoints with GPS per race
- New /api/races and /api/races/{id}/stations endpoints
- Upload now requires race + station selection; uses station GPS
so images without GPS EXIF are accepted
- passages filtered by active race throughout
- RacePage: create races, manage stations (add/edit/delete checkpoints)
- Navbar shows active race name
- Start and finish stations created automatically per race
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -25,6 +25,7 @@ async def init_db(db: aiosqlite.Connection) -> None:
|
||||
|
||||
CREATE TABLE IF NOT EXISTS passages (
|
||||
passage_id TEXT PRIMARY KEY,
|
||||
race_id TEXT REFERENCES races(race_id),
|
||||
profile_id TEXT REFERENCES athletes(profile_id),
|
||||
bib_number TEXT,
|
||||
station TEXT NOT NULL,
|
||||
@@ -50,12 +51,16 @@ async def init_db(db: aiosqlite.Connection) -> None:
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_passages_profile ON passages(profile_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_passages_race ON passages(race_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_passages_station ON passages(station);
|
||||
CREATE INDEX IF NOT EXISTS idx_passages_needs_review ON passages(needs_review);
|
||||
CREATE INDEX IF NOT EXISTS idx_passage_images_passage ON passage_images(passage_id);
|
||||
""")
|
||||
await db.commit()
|
||||
|
||||
from race_db import init_race_tables
|
||||
await init_race_tables(db)
|
||||
|
||||
|
||||
async def get_db() -> aiosqlite.Connection:
|
||||
db = await aiosqlite.connect(DB_PATH)
|
||||
|
||||
Reference in New Issue
Block a user