Skip to content

Commit c7e5807

Browse files
committed
Freebuff waiting room backend
1 parent 3a76beb commit c7e5807

File tree

19 files changed

+5053
-4
lines changed

19 files changed

+5053
-4
lines changed

docs/freebuff-waiting-room.md

Lines changed: 282 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
CREATE TYPE "public"."free_session_status" AS ENUM('queued', 'active');--> statement-breakpoint
2+
CREATE TABLE "free_session" (
3+
"user_id" text PRIMARY KEY NOT NULL,
4+
"status" "free_session_status" NOT NULL,
5+
"active_instance_id" text NOT NULL,
6+
"queued_at" timestamp with time zone DEFAULT now() NOT NULL,
7+
"admitted_at" timestamp with time zone,
8+
"expires_at" timestamp with time zone,
9+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
10+
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
11+
);
12+
--> statement-breakpoint
13+
ALTER TABLE "free_session" ADD CONSTRAINT "free_session_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
14+
CREATE INDEX "idx_free_session_queue" ON "free_session" USING btree ("status","queued_at");--> statement-breakpoint
15+
CREATE INDEX "idx_free_session_expiry" ON "free_session" USING btree ("expires_at");

0 commit comments

Comments
 (0)