openvibers/openvibe.live Commits

Migrations: the Rundown's audiences are 0030 (two 0029s on main) (#644)

OP OpenVibers committed 6 days ago · 6ea003f97a · 3 files, +39 −39

migrate refuses two migrations with one number, so main could not boot. Neither has run in production (it is at
0028). The agent voice keeps 0029; the Rundown's audiences move to 0030.

Changes

ddiff --git a/docs/rundown.md b/docs/rundown.md
iindex 9a33a245..f62e1f3f 100644
---- a/docs/rundown.md
++++ b/docs/rundown.md
@@@ -152,7 +152,7 @@ Migration `0010_rundown.sql`:
- `rundown_progress`: how far the desk has read each stream.
- `rundown_reactions`: readers' reactions.
--Migration `0029_rundown_audiences.sql` (expand only, 2026-11-06) holds what the sharing system does not know:
++Migration `0030_rundown_audiences.sql` (expand only, 2026-11-06) holds what the sharing system does not know:
- `rundown_visibility`: per stream, what the recording decides as the last thing Live heard about it (`vod_audience`, and `vod_members` for Specific people, which Media has no notion of). A stream with no row is Everyone.
- `rundown_prefs`: the streamer's default audience for new write-ups. No row is Everyone.
ddiff --git a/migrations/0029_rundown_audiences.sql b/migrations/0029_rundown_audiences.sql
ddeleted file mode 100644
iindex 447113c6..00000000
---- a/migrations/0029_rundown_audiences.sql
++++ /dev/null
@@@ -1,38 +0,0 @@
---- phase: expand
---- The audiences of The Rundown (design 2026-11-06, plan-state-2026-10-22/RUNDOWN-CONTROLS-AND-BROWSE-DESIGN-2026-11-06.md).
----
---- Who sees a streamer's Rundown is one setting, not four: Everyone, Anyone with the link, Specific people or Only me.
---- Those are the sharing system's own audiences (openvibe-sdk/share, share.v1), and the episode's own setting lives
---- there, in the share row of kind 'rundown-episode' (server/rundown/sharing.js). This table holds only what the
---- sharing system does not know:
----
---- vod_audience what the recording decides, as the last thing Live heard about it. Live applies the rule itself:
---- the episode's audience is the stricter of its own setting and this (Only me, then Specific people,
---- then Anyone with the link, then Everyone). A change made through Live's own pages is applied in the
---- same request (server/media-proxy/vods.js); a change made elsewhere arrives as Media's
---- media.object.visibility_changed event; until that lands the episode page re-checks the recording
---- through media-client (cached 60 s, server/rundown/visibility.js).
----
---- Expand only: a stream with no row is Everyone, so every older release and every older row keeps working.
--CREATE TABLE IF NOT EXISTS rundown_visibility (
-- stream_id bigint PRIMARY KEY REFERENCES streams(id) ON DELETE CASCADE,
-- vod_audience text COLLATE "C" NOT NULL DEFAULT 'public',
-- vod_members jsonb NOT NULL DEFAULT '[]'::jsonb CHECK (vod_audience IN ('public','link','people','private')),
-- updated_at text COLLATE "C" DEFAULT ov_now()
--);
--
---- The streamer's own default for the episodes written up for them ("My Rundown" settings). Nobody has a row until
---- they change it: no row is Everyone.
--CREATE TABLE IF NOT EXISTS rundown_prefs (
-- user_id bigint PRIMARY KEY REFERENCES users(id) ON DELETE CASCADE,
-- default_audience text COLLATE "C" NOT NULL DEFAULT 'public' CHECK (default_audience IN ('public','link','people','private')),
-- updated_at text COLLATE "C" DEFAULT ov_now()
--);
--
---- A write-up the streamer deleted. The desk must not write that stream up again on its own; only the streamer asking
---- for it ("Write this stream up again") clears the row.
--CREATE TABLE IF NOT EXISTS rundown_deleted (
-- stream_id bigint PRIMARY KEY REFERENCES streams(id) ON DELETE CASCADE,
-- user_id bigint NOT NULL,
-- deleted_at text COLLATE "C" DEFAULT ov_now()
--);
ddiff --git a/migrations/0030_rundown_audiences.sql b/migrations/0030_rundown_audiences.sql
nnew file mode 100644
iindex 00000000..447113c6
---- /dev/null
++++ b/migrations/0030_rundown_audiences.sql
@@@ -0,0 +1,38 @@
++-- phase: expand
++-- The audiences of The Rundown (design 2026-11-06, plan-state-2026-10-22/RUNDOWN-CONTROLS-AND-BROWSE-DESIGN-2026-11-06.md).
++--
++-- Who sees a streamer's Rundown is one setting, not four: Everyone, Anyone with the link, Specific people or Only me.
++-- Those are the sharing system's own audiences (openvibe-sdk/share, share.v1), and the episode's own setting lives
++-- there, in the share row of kind 'rundown-episode' (server/rundown/sharing.js). This table holds only what the
++-- sharing system does not know:
++--
++-- vod_audience what the recording decides, as the last thing Live heard about it. Live applies the rule itself:
++-- the episode's audience is the stricter of its own setting and this (Only me, then Specific people,
++-- then Anyone with the link, then Everyone). A change made through Live's own pages is applied in the
++-- same request (server/media-proxy/vods.js); a change made elsewhere arrives as Media's
++-- media.object.visibility_changed event; until that lands the episode page re-checks the recording
++-- through media-client (cached 60 s, server/rundown/visibility.js).
++--
++-- Expand only: a stream with no row is Everyone, so every older release and every older row keeps working.
++CREATE TABLE IF NOT EXISTS rundown_visibility (
++ stream_id bigint PRIMARY KEY REFERENCES streams(id) ON DELETE CASCADE,
++ vod_audience text COLLATE "C" NOT NULL DEFAULT 'public',
++ vod_members jsonb NOT NULL DEFAULT '[]'::jsonb CHECK (vod_audience IN ('public','link','people','private')),
++ updated_at text COLLATE "C" DEFAULT ov_now()
++);
++
++-- The streamer's own default for the episodes written up for them ("My Rundown" settings). Nobody has a row until
++-- they change it: no row is Everyone.
++CREATE TABLE IF NOT EXISTS rundown_prefs (
++ user_id bigint PRIMARY KEY REFERENCES users(id) ON DELETE CASCADE,
++ default_audience text COLLATE "C" NOT NULL DEFAULT 'public' CHECK (default_audience IN ('public','link','people','private')),
++ updated_at text COLLATE "C" DEFAULT ov_now()
++);
++
++-- A write-up the streamer deleted. The desk must not write that stream up again on its own; only the streamer asking
++-- for it ("Write this stream up again") clears the row.
++CREATE TABLE IF NOT EXISTS rundown_deleted (
++ stream_id bigint PRIMARY KEY REFERENCES streams(id) ON DELETE CASCADE,
++ user_id bigint NOT NULL,
++ deleted_at text COLLATE "C" DEFAULT ov_now()
++);