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

Remove OneToOne user, add unique_together user and opportunity on Opportunity Access #112

Merged
merged 1 commit into from
Sep 13, 2023

Conversation

pxwxnvermx
Copy link
Contributor

@pxwxnvermx pxwxnvermx commented Sep 12, 2023

Issue: The OneToOne foriegn key on user field on Opportunity Access model blocked the user to have access to different opportunity because the OneToOne field also creates a unique index on the field leading to a unique constraint violation when we tried to create access to multiple opportunities for a User.

Fix: Removed OneToOne on user and added a unique together for opportunity and user since a user can have access to a single opportunity only once.

@pxwxnvermx pxwxnvermx self-assigned this Sep 12, 2023
@pxwxnvermx pxwxnvermx merged commit 73c56ab into main Sep 13, 2023
@pxwxnvermx pxwxnvermx deleted the pkv/fix-opportunity-access-model-user-foreign-key branch September 13, 2023 04:59
@pxwxnvermx pxwxnvermx restored the pkv/fix-opportunity-access-model-user-foreign-key branch September 13, 2023 05:02
@pxwxnvermx pxwxnvermx deleted the pkv/fix-opportunity-access-model-user-foreign-key branch September 13, 2023 05:03
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.

3 participants