Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unique constraint to Hacker and update relations #66

Merged
merged 9 commits into from
Oct 15, 2024

Conversation

MatejMa2ur
Copy link
Member

This commit ensures that each hacker-user pairing for a hackathon is unique by adding a new unique constraint on the Hacker table. It also modifies the User model to reflect a one-to-many relationship with Hacker instead of a one-to-one relationship.

This commit ensures that each hacker-user pairing for a hackathon is unique by adding a new unique constraint on the `Hacker` table. It also modifies the `User` model to reflect a one-to-many relationship with `Hacker` instead of a one-to-one relationship.
The unique constraint on the combined fields userId and hackathonId in the HackerApplication model has been removed. This change allows for multiple entries with the same userId and hackathonId combination. The modification addresses issues related to duplicative data entries for users in the same hackathon.
This commit drops the unique index "Hacker_userId_hackathonId_key". This change allows multiple records with the same combination of userId and hackathonId.
feat: add composite unique constraint to Hacker model

Introduce a composite unique constraint on userId and hackathonId in the Hacker model to ensure unique applications per user per hackathon. Also, update related application logic to accommodate the new constraint.
```
Ensure unique constraint on userId and hackathonId columns. This prevents duplicate entries and enforces data integrity for hacker-hackathon pairs.
Added hackathonId parameter to getApplicationFormStep function to better filter hacker records. This change ensures that hackers are correctly associated with their respective hackathons.
Integrated the retrieval of the active hackathon ID into hacker session validation and form step data fetching. This ensures that operations are scoped to the current active hackathon.
Removed unnecessary hackathon ID check in requireHackerSession and updated query to order by creation date. Enhanced isApplicationComplete to include detailed application and hacker validation.
@MatejMa2ur MatejMa2ur merged commit f1e7b99 into main Oct 15, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant