- Add unique index on (sports_season_id, name) in participants table - findParticipantByName uses case-insensitive lower() comparison - Single add: check for existing name before insert, return clear error - Bulk add: load existing names once upfront (1 query vs N), dedup input case-insensitively, report skipped names in UI - Fix golf-skills and surface-elo routes which called createParticipant without any duplicate guard (would have thrown DB constraint errors) Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 line
No EOL
133 B
SQL
1 line
No EOL
133 B
SQL
CREATE UNIQUE INDEX IF NOT EXISTS "participants_sports_season_name_unique" ON "participants" USING btree ("sports_season_id","name"); |