Added collations migration to make username lookups case-insensitive (#2803) #2974
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes / Features implemented
Updated solution from the previous pull request #2966
Added a database migration that adds collations to the auth_user username field so username lookups within the API endpoints become case-insensitive.
Added a regression test (TestCaseInsensitiveUserQuery) that confirms /api/v1/profiles.json?users= correctly matches users regardless of casing (bob, Bob, bOb, etc.).
Steps taken to verify this change does what is intended
Manual verification of the migration was done to ensure that the collation was properly added
Manual verification of the API endpoints in curl was done in accordance to the example in the original #2803 post to ensure correct behavior
Test case was ran with different variants of the target username in order to make sure applying the collation leads for case insensitivity.
Side effects of implementing this change
Api endpoints such as:
and
are now case insensitive
Before submitting this PR for review, please make sure you have: