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

Fix unique constrains #9

Merged
merged 2 commits into from
Mar 8, 2022
Merged

Fix unique constrains #9

merged 2 commits into from
Mar 8, 2022

Conversation

CarlSchwan
Copy link
Member

@CarlSchwan CarlSchwan commented Mar 1, 2022

This fix an issue where the unique index created was for a pair of <userId, token> instead of having a unique index on the userId and a unique index on the token.

If there are more than one entry with the same userId, we delete the other one. It's safe because we need at most one and the other one will just generate additional noice.

Signed-off-by: Carl Schwan carl@carlschwan.eu

@CarlSchwan CarlSchwan self-assigned this Mar 1, 2022
@CarlSchwan CarlSchwan marked this pull request as draft March 1, 2022 12:13
@CarlSchwan CarlSchwan marked this pull request as ready for review March 1, 2022 13:01
@CarlSchwan CarlSchwan requested review from juliusknorr, a team, blizzz, vanpertsch and nickvergessen and removed request for a team March 1, 2022 13:01
@nickvergessen nickvergessen added the bug Something isn't working label Mar 4, 2022
@CarlSchwan CarlSchwan force-pushed the fix/unique-constrains branch 2 times, most recently from 2dbb18d to c2d04fb Compare March 7, 2022 16:00
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Co-Authored-By: Joas Schilling <coding@schilljs.com>
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Copy link
Member

@nickvergessen nickvergessen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume you tested this. LGTM

@CarlSchwan CarlSchwan merged commit 9990f79 into master Mar 8, 2022
@delete-merged-branch delete-merged-branch bot deleted the fix/unique-constrains branch March 8, 2022 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants