feat: redesign match play and add broadcast tooling
This commit is contained in:
30
scripts/migrations/0010-streaming.sql
Normal file
30
scripts/migrations/0010-streaming.sql
Normal file
@@ -0,0 +1,30 @@
|
||||
-- Streaming to platforms, recordings and on-site playback.
|
||||
ALTER TABLE broadcast_channel ADD COLUMN IF NOT EXISTS format text NOT NULL DEFAULT 'landscape';
|
||||
ALTER TABLE broadcast_channel ADD COLUMN IF NOT EXISTS quality text NOT NULL DEFAULT '1080p30';
|
||||
ALTER TABLE broadcast_channel ADD COLUMN IF NOT EXISTS live boolean NOT NULL DEFAULT false;
|
||||
ALTER TABLE broadcast_channel ADD COLUMN IF NOT EXISTS record boolean NOT NULL DEFAULT true;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS broadcast_destination (
|
||||
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
channel_id uuid NOT NULL REFERENCES broadcast_channel(id) ON DELETE CASCADE,
|
||||
platform text NOT NULL,
|
||||
label text NOT NULL,
|
||||
ingest_url text NOT NULL,
|
||||
stream_key text NOT NULL,
|
||||
enabled boolean NOT NULL DEFAULT true,
|
||||
created_at timestamptz NOT NULL DEFAULT now()
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS idx_broadcast_destination_channel ON broadcast_destination (channel_id);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS broadcast_session (
|
||||
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
channel_id uuid NOT NULL REFERENCES broadcast_channel(id) ON DELETE CASCADE,
|
||||
started_at timestamptz NOT NULL DEFAULT now(),
|
||||
ended_at timestamptz,
|
||||
seen_at timestamptz NOT NULL DEFAULT now(),
|
||||
storage_prefix text,
|
||||
duration_sec integer NOT NULL DEFAULT 0,
|
||||
chapters jsonb NOT NULL DEFAULT '[]',
|
||||
destinations jsonb NOT NULL DEFAULT '[]'
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS idx_broadcast_session_channel ON broadcast_session (channel_id, started_at);
|
||||
Reference in New Issue
Block a user