weavesignal/crates/model/migrations/0021_episode_maker.sql
The WeaveSignal contributors 466b32ab6a WeaveSignal 1.0.0 — release one
The first public release. What it does: https://weavesignal.top; what changed: CHANGELOG.md.
2026-11-04 12:15:42 +00:00

9 lines
629 B
SQL

-- SPDX-License-Identifier: AGPL-3.0-only
-- Who made an episode (ADR-0198): a correction to an aired episode is allowed to admins and to
-- the staff member who made it. `made_by` names the maker as the logs do (a username, or
-- "station key"), kept as text so it survives the account; `made_by_account` points at the staff
-- account while it exists. Episodes made before this have neither, and only admins correct them.
ALTER TABLE episode
ADD COLUMN made_by text CHECK (made_by IS NULL OR length(made_by) BETWEEN 1 AND 120),
ADD COLUMN made_by_account uuid REFERENCES staff_account (id) ON DELETE SET NULL;