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

Bug: Cat Slugs Are Globally Unique #222

Open
TheTedder opened this issue Aug 11, 2024 · 1 comment
Open

Bug: Cat Slugs Are Globally Unique #222

TheTedder opened this issue Aug 11, 2024 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@TheTedder
Copy link
Contributor

Cat slugs are globally unique instead of unique to LBs.

Step(s) to Reproduce

Create a category with a slug that has been used for a different game but not the current game.

Expected Result

The category is created successfully.

Actual Outcome

The category fails to be created because its slug is "already used" by a different leaderboard.

How to Fix This

Change the uniqueness constraint so that it includes the leaderboard_id field too.

@TheTedder TheTedder added the bug Something isn't working label Aug 11, 2024
@TheTedder TheTedder added this to the MVP milestone Aug 11, 2024
@TheTedder TheTedder self-assigned this Aug 29, 2024
@TheTedder
Copy link
Contributor Author

Note: Make sure the Leaderboard ID is specified as the first column of the index for performance reasons:

A multicolumn B-tree index can be used with query conditions that involve any subset of the index's columns, but the index is most efficient when there are constraints on the leading (leftmost) columns. The exact rule is that equality constraints on leading columns, plus any inequality constraints on the first column that does not have an equality constraint, will be used to limit the portion of the index that is scanned. Constraints on columns to the right of these columns are checked in the index, so they save visits to the table proper, but they do not reduce the portion of the index that has to be scanned.

@erunks erunks added this to MVP Nov 8, 2024
@github-project-automation github-project-automation bot moved this to To do in MVP Nov 8, 2024
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
Status: To do
Development

No branches or pull requests

1 participant