feat(backend): implement REST API for races calendar
Express + TypeScript backend with PostgreSQL: CRUD endpoints for /races (GET list with year/month filters, GET by id, POST, PATCH, DELETE), health/readiness probes, SQL migration runner, seed script with upsert from CSV, camelCase/snake_case mapper, CORS, env validation, docker-compose, and API docs for frontend. Made-with: Cursor
This commit is contained in:
16
backend/migrations/001_create_races.sql
Normal file
16
backend/migrations/001_create_races.sql
Normal file
@@ -0,0 +1,16 @@
|
||||
CREATE TABLE IF NOT EXISTS races (
|
||||
id TEXT PRIMARY KEY,
|
||||
race_date DATE NOT NULL,
|
||||
title TEXT NOT NULL,
|
||||
distance_km NUMERIC(6,3) NOT NULL,
|
||||
status TEXT CHECK (status IN ('planned', 'completed')),
|
||||
official_url TEXT,
|
||||
start_time TEXT,
|
||||
cluster_schedule TEXT,
|
||||
bib_pickup TEXT,
|
||||
bib_number TEXT,
|
||||
finish_time TEXT,
|
||||
notes TEXT,
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
||||
updated_at TIMESTAMPTZ
|
||||
);
|
||||
Reference in New Issue
Block a user