Files
dhkatzandClaude Opus 5.5 2a1fc94df6
CI / test (push) Successful in 1m5s
Hosted rooms: the hub's side
Rooms made on the website (hosted_room, migration 0005), the REST routes in
docs/hosted-rooms.md, and the realtime room.* protocol: joining with the
capacity, adult and linked-account rules, seats, numbered messages with
forged senders dropped and a rate limit, closing. The Rooms page lists them,
with a form to make one and the owner's edit and close.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 03:21:21 -07:00

19 lines
957 B
SQL

CREATE TABLE "hosted_room" (
"n" serial PRIMARY KEY NOT NULL,
"owner_id" text NOT NULL,
"owner_imvu_id" bigint NOT NULL,
"name" text NOT NULL,
"description" text DEFAULT '' NOT NULL,
"room_pid" bigint NOT NULL,
"rating" text DEFAULT 'general' NOT NULL,
"max_users" integer DEFAULT 10 NOT NULL,
"scene" jsonb DEFAULT '[]'::jsonb NOT NULL,
"scene_hash" text DEFAULT '' NOT NULL,
"closed" boolean DEFAULT false NOT NULL,
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
);
--> statement-breakpoint
ALTER TABLE "hosted_room" ADD CONSTRAINT "hosted_room_owner_id_user_id_fk" FOREIGN KEY ("owner_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
CREATE INDEX "hosted_room_owner" ON "hosted_room" USING btree ("owner_id");--> statement-breakpoint
CREATE INDEX "hosted_room_created" ON "hosted_room" USING btree ("created_at");