Fix migration 0068: add IF NOT EXISTS to enum ADD VALUE (#269)

The migration fails in production because the enum label
"cs2_major_qualifying_points" already exists. Adding IF NOT EXISTS
makes the statement idempotent so it won't error on re-run.

https://claude.ai/code/session_015iUtjSgiL1ZUNggvj434gP

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Chris Parsons 2026-04-06 11:12:13 -04:00 committed by GitHub
parent 1ee0d51fb3
commit 90127fe5bd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,4 +1,4 @@
ALTER TYPE "public"."simulator_type" ADD VALUE 'cs2_major_qualifying_points';--> statement-breakpoint ALTER TYPE "public"."simulator_type" ADD VALUE IF NOT EXISTS 'cs2_major_qualifying_points';--> statement-breakpoint
CREATE TABLE IF NOT EXISTS "cs2_major_stage_results" ( CREATE TABLE IF NOT EXISTS "cs2_major_stage_results" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL, "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"scoring_event_id" uuid NOT NULL, "scoring_event_id" uuid NOT NULL,