Files
Dune/drizzle/0016_seat_discussion_controls.sql
Quintine 160fdc1f30 Prototype administrative discussion mute controls
Let owners/operators mute or unmute new public/private sends from a human seat while retaining history, incoming messages, gameplay and credentials. Fence metadata and durable audit writes with live authority, membership and versions. Preserve exact admin/message retries and inherit restrictions through seat recovery.

Validation: types/lint, 5431 offline tests, build, 52 HTTP integration tests, 24 administrator HTTP groups, independent SQL/privacy/UI review and desktop/mobile refresh acceptance. All 2230 prior games and 4746 seats preserved. Additive migration 0016. Verified runtime fingerprint 588967fbb9c2e3b6abe2990c4fce96ee69e2256fb7e3ee416314b87593cebba9; documentation-only grammar/button-label review gives b5e57bdd26812debede91c588e38f247f1fa895ad23e7ae30bc8550eedcd90ec. New-revision deployed acceptance remains open; full admin/rules scope is unfinished.
2026-09-26 14:30:52 +10:00

27 lines
1.0 KiB
SQL

CREATE TABLE `admin_discussion_operations` (
`operation_id` text PRIMARY KEY NOT NULL,
`actor_admin_id` text NOT NULL,
`room_code` text NOT NULL,
`request_hash` text NOT NULL,
`expected_version` integer NOT NULL,
`expected_revision` integer NOT NULL,
`applied_revision` integer NOT NULL,
`target` text NOT NULL,
`muted` integer NOT NULL,
`reason` text NOT NULL,
`created_at` integer NOT NULL
);
--> statement-breakpoint
CREATE INDEX `admin_discussion_room` ON `admin_discussion_operations` (`room_code`,`created_at`);--> statement-breakpoint
CREATE TABLE `seat_discussion_controls` (
`room_code` text NOT NULL,
`player_id` text NOT NULL,
`muted` integer DEFAULT 0 NOT NULL,
`revision` integer DEFAULT 0 NOT NULL,
`updated_at` integer NOT NULL,
PRIMARY KEY(`room_code`, `player_id`),
FOREIGN KEY (`room_code`) REFERENCES `rooms`(`code`) ON UPDATE no action ON DELETE cascade,
CONSTRAINT "seat_discussion_muted" CHECK("seat_discussion_controls"."muted" IN (0, 1)),
CONSTRAINT "seat_discussion_revision" CHECK("seat_discussion_controls"."revision" >= 0)
);