Skip to content

Sync: dev to main - #454

Merged
aamoghS merged 3 commits into
mainfrom
dev
Oct 1, 2026
Merged

aamoghS merged 3 commits into
mainfrom
dev

Conversation

@github-actions

@github-actions github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Automated PR tracking changes from dev into main.


Note

Medium Risk
Schema-level uniqueness enforcement changes require a successful DB push/migration; misalignment between code and deployed indexes could break duplicate detection until migrated.

Overview
Replaces Drizzle unique() table constraints with explicitly named uniqueIndex() definitions across bootcamp, events, hackathons, initiatives, and judge schemas. Index names follow a consistent pattern (e.g. hackathon_participant_hackathon_user_idx, event_check_in_event_user_idx) so drizzle-kit push stops treating column order as a perpetual diff and re-creating constraints on every deploy.

Registration and scan flows still map Postgres 23505 violations to friendly errors; registration.ts now recognizes duplicates via hackathon_participant_hackathon_user_idx, and comments in admin.ts reference event_attendee_event_participant_idx. Internal edge tests were updated so mocked duplicate-key messages match the new index names.

Reviewed by Cursor Bugbot for commit c487f8f. Bugbot is set up for automated code reviews on this repo. Configure here.

aamoghS and others added 3 commits October 1, 2026 17:01
Same drizzle-kit bug as event_bootcamp_session_idx: constraint
columns are introspected with no ORDER BY. Against prod,
unique_judge_per_hackathon and unique_assignment_per_hackathon are
dropped and re-added on every push. Both tables are empty today, so
push passes; the first deploy after a judge registers would stop at
the TTY prompt. unique_event_check_in has 36 rows and would stall
the moment its introspected order flips.

Unique indexes are introspected by column position. Verified on a
restored prod dump: the first push swaps all three, later pushes
leave them alone, db:check passes, check-in rows are kept.
Converts the last six multi-column unique constraints (bootcamp
workshop, hackathon participant, interest, event attendee,
announcement recipient, initiative application) to unique indexes,
for the same drizzle-kit introspection bug as the previous commit.
hackathon_interest (123 rows) and initiative_application (74 rows)
would stall a deploy at the TTY prompt the first time push read
their columns out of order.

registration.ts matched the old constraint name as a fallback to the
23505 check; it now matches the index name, as do the test mocks.

Verified on a restored prod dump: one push swaps all nine with no
prompt, later pushes leave them alone, db:check passes, row counts
unchanged. api tests: 604 passed.
fix(db): make composite unique constraints unique indexes
@github-actions
github-actions Bot requested a review from aamoghS as a code owner October 1, 2026 21:31
@aamoghS
aamoghS merged commit e790596 into main Oct 1, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant