CREATE TABLE "crash_rounds" ( "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL, "round_id" varchar(32) NOT NULL, "user_id" uuid NOT NULL, "game_id" uuid NOT NULL, "game_slug" varchar(64) NOT NULL, "game_version" varchar(16) NOT NULL, "client_round_id" uuid NOT NULL, "bet" bigint NOT NULL, "crash_multiplier" numeric(12, 2) NOT NULL, "crash_at_ms" integer NOT NULL, "seed" text NOT NULL, "commitment" varchar(64) NOT NULL, "events" jsonb DEFAULT '[]'::jsonb NOT NULL, "auto_cashout" numeric(12, 2), "status" varchar(12) DEFAULT 'running' NOT NULL, "cashout_multiplier" numeric(12, 2), "win" bigint DEFAULT 0 NOT NULL, "started_at" timestamp with time zone DEFAULT now() NOT NULL, "settled_at" timestamp with time zone ); --> statement-breakpoint ALTER TABLE "crash_rounds" ADD CONSTRAINT "crash_rounds_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint ALTER TABLE "crash_rounds" ADD CONSTRAINT "crash_rounds_game_id_games_id_fk" FOREIGN KEY ("game_id") REFERENCES "public"."games"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint CREATE UNIQUE INDEX "crash_rounds_round_id_idx" ON "crash_rounds" USING btree ("round_id");--> statement-breakpoint CREATE UNIQUE INDEX "crash_rounds_user_client_idx" ON "crash_rounds" USING btree ("user_id","client_round_id");--> statement-breakpoint CREATE INDEX "crash_rounds_user_status_idx" ON "crash_rounds" USING btree ("user_id","status");