DROP INDEX IF EXISTS "team_score_events_unique";--> statement-breakpoint
ALTER TABLE "team_score_events" ADD COLUMN "match_id" uuid;--> statement-breakpoint
CREATE UNIQUE INDEX IF NOT EXISTS "team_score_events_match_unique" ON "team_score_events" USING btree ("team_id","season_id","match_id") WHERE match_id IS NOT NULL;--> statement-breakpoint
CREATE UNIQUE INDEX IF NOT EXISTS "team_score_events_event_unique" ON "team_score_events" USING btree ("team_id","season_id","scoring_event_id") WHERE match_id IS NULL;