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 uniqueness constraints to cugs to take care of user_group_ids received from classrooms sometimes looking strange #47

Merged
merged 1 commit into from
Oct 23, 2023

Conversation

yuenmichelle1
Copy link
Collaborator

@yuenmichelle1 yuenmichelle1 commented Oct 23, 2023

This hasn't happened yet, but I did notice that some classifications coming from classrooms will send metadata.user_group_ids with duplicates. (Eg. user_group_ids: [1234, 1234, 1234]).
Adding uniqueness constraints to classification_user_groups to ensure that duplicates do not get created for classification.

Prework:
checked if there were any duplicates in staging and production:
SQL query:
select * from classification_user_groups ou where (select count(*) from classification_user_groups inr where inr.classification_id = ou.classification_id and inr.user_group_id = ou.user_group_id) > 1
there are 0 in both, but this could theoretically happen especially with finishing up the rest of ERAS backfill (Phase 4 Part 1, Creating Classification User Groups from backfilled classification_events)

…eived from classrooms sometimes looking strange
db/schema.rb Show resolved Hide resolved
db/schema.rb Show resolved Hide resolved
db/schema.rb Show resolved Hide resolved
db/schema.rb Show resolved Hide resolved
db/schema.rb Show resolved Hide resolved
@yuenmichelle1 yuenmichelle1 requested a review from zwolf October 23, 2023 18:41
@yuenmichelle1 yuenmichelle1 merged commit 6797dab into main Oct 23, 2023
3 checks passed
@yuenmichelle1 yuenmichelle1 deleted the add-uniqueness-to-classification-user-groups branch October 26, 2023 00:20
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.

2 participants