|
|
@ -141,16 +141,24 @@ CREATE TABLE editors (
|
|
|
|
name TEXT NOT NULL
|
|
|
|
name TEXT NOT NULL
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- A slight misnomer, this is all rows of the tags sheet.
|
|
|
|
|
|
|
|
-- It includes tags that have been promoted to actual playlists, and ones that have not.
|
|
|
|
-- Playlists are communicated to playlist manager via this table.
|
|
|
|
-- Playlists are communicated to playlist manager via this table.
|
|
|
|
CREATE TABLE playlists (
|
|
|
|
CREATE TABLE playlists (
|
|
|
|
playlist_id TEXT PRIMARY KEY,
|
|
|
|
id TEXT PRIMARY KEY,
|
|
|
|
name TEXT NOT NULL,
|
|
|
|
-- These are sheet inputs, and aren't used directly by anything (except reverse sync)
|
|
|
|
|
|
|
|
name TEXT NOT NULL DEFAULT '',
|
|
|
|
|
|
|
|
description TEXT NOT NULL DEFAULT ''
|
|
|
|
-- When tags is NULL, it indicates tags have not been set and so the playlist should
|
|
|
|
-- When tags is NULL, it indicates tags have not been set and so the playlist should
|
|
|
|
-- match nothing. Conversely, when tags is empty, it indicates the playlist should match everything.
|
|
|
|
-- match nothing. Conversely, when tags is empty, it indicates the playlist should match everything.
|
|
|
|
tags TEXT[],
|
|
|
|
tags TEXT[],
|
|
|
|
first_event_id UUID REFERENCES events(id) ON DELETE SET NULL,
|
|
|
|
playlist_id TEXT,
|
|
|
|
last_event_id UUID REFERENCES events(id) ON DELETE SET NULL,
|
|
|
|
show_in_description BOOLEAN NOT NULL DEFAULT FALSE,
|
|
|
|
show_in_description BOOLEAN NOT NULL
|
|
|
|
-- These event ids are references into the events table, but they aren't foreign keys
|
|
|
|
|
|
|
|
-- because we don't want invalid input to cause integrity errors.
|
|
|
|
|
|
|
|
-- It's totally safe for these to point to non-existent events, it just does nothing.
|
|
|
|
|
|
|
|
first_event_id TEXT,
|
|
|
|
|
|
|
|
last_event_id TEXT
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
-- This table records time series data gleaned from the bus cam (right now, just the odometer).
|
|
|
|
-- This table records time series data gleaned from the bus cam (right now, just the odometer).
|
|
|
|