diff --git a/database/schema.ts b/database/schema.ts index bff5ea5..37f009b 100644 --- a/database/schema.ts +++ b/database/schema.ts @@ -580,7 +580,12 @@ export const eventResults = pgTable("event_results", { rawScore: decimal("raw_score", { precision: 10, scale: 2 }), // strokes, points, time, etc. createdAt: timestamp("created_at").defaultNow().notNull(), updatedAt: timestamp("updated_at").defaultNow().notNull(), -}); +}, (t) => ({ + uniqueEventParticipant: uniqueIndex("event_results_event_participant_unique").on( + t.scoringEventId, + t.seasonParticipantId, + ), +})); // Playoff bracket matches (for display and tracking) export const playoffMatches = pgTable("playoff_matches", {