mirror of
https://github.com/IS1DI/x0gp.git
synced 2026-07-16 20:47:55 +00:00
12 lines
433 B
SQL
12 lines
433 B
SQL
-- 014_track_calendar.sql — schema for F1-style active track scheduling.
|
|
|
|
CREATE TABLE IF NOT EXISTS track_calendar (
|
|
id SERIAL PRIMARY KEY,
|
|
track_id TEXT NOT NULL REFERENCES tracks(id) ON DELETE CASCADE,
|
|
start_at TIMESTAMP WITH TIME ZONE NOT NULL,
|
|
end_at TIMESTAMP WITH TIME ZONE NOT NULL,
|
|
CHECK (start_at < end_at)
|
|
);
|
|
|
|
CREATE INDEX IF NOT EXISTS track_calendar_dates_idx ON track_calendar (start_at, end_at);
|