brackt/scripts
Chris Parsons f3937d0d84
feat: auto-provision canonical tournaments and participants on create
Creating new qualifying scoring_events or season_participants now
auto-upserts the matching canonical rows. Needed so the check constraint
doesn't reject qualifying events, and so new season participants
flow through syncTournamentResults.

- Extract tournament identity shared between backfill and event-creation
  into app/lib/tournament-identity.ts; scripts/backfill re-exports it.
- createScoringEvent + bulkCreateScoringEvents now accept tournamentId.
- Event creation routes auto-compute (name, year) and upsert tournament.
- createParticipant + createManyParticipants auto-link to canonical
  participants by (sportId, name).

Phase 3 Task 7 of canonical tournament layer migration.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 22:32:16 +00:00
..
__tests__ scripts: add backfill orchestrator for canonical layer 2026-05-01 20:57:38 +00:00
backfill feat: auto-provision canonical tournaments and participants on create 2026-05-01 22:32:16 +00:00
backfill-canonical-layer.ts scripts: add backfill orchestrator for canonical layer 2026-05-01 20:57:38 +00:00
backfill-cli.ts fix(backfill-cli): exit 0 on success so pg pool doesn't block 2026-05-01 21:07:26 +00:00
build-server.mjs refactor: migrate server code from JavaScript to TypeScript with build pipeline 2025-10-18 22:16:04 -07:00
capture-baseline.ts Fix capture-baseline.ts: postgres-js returns rows directly 2026-05-01 06:07:14 +00:00
migrate-clerk-passwords.mjs Migrate authentication from Clerk to BetterAuth (#324) 2026-04-24 22:00:49 -07:00
migrate.mjs Fix migrate.mjs: also convert leagues.created_by from Clerk IDs to UUIDs 2026-04-24 22:46:14 -07:00
sync-prod-db.sh Load PROD_DATABASE_URL from .env automatically (#259) 2026-04-03 15:38:09 -07:00