Add unique index to `users.username`
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Start by reading migrations/20150319224700_dumped_migration_93/up.sql for canon_crate_name and migrations/20150319224701_dumped_migration_94/up.sql for the existing crate-name index. Verify that users.username is currently unique before deployment, then add a migration with the normalized unique username index; done means the migration applies successfully and the uniqueness check passes.
Written by the indexing model from the issue text.
Description
We have a postgres function canon_crate_name that replaces hyphens with underscores and lowercases strings. This function is used for the unique crate name index and should be used for the unique username index as well.
I'm open to arguments about whether we should rename canon_crate_name to be something more general such as canon_name or normalized_identifier or similar, or whether we should keep the function name canon_crate_name even as we use it for usernames too.
The PR for this issue should include a migration that adds a unique username index as detailed above.
The admin that deploys this should verify that users.username is actually unique before deploying.
- Dominant language
- Rust
- Stars
- 3.7k
- Forks
- 751
- Avg merge
- 16h 6m
- Merged PRs (30d)
- 225
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rust-lang/crates.io
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
A-backend ⚙️ C-enhancement ✨
Difficulty 4/5 3-5 days Newbie friendliness 55/100
-
A-frontend 🐹 C-bug 🐞
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
A-backend ⚙️ A-publish C-enhancement ✨ C-internal 🔧
-
A-infrastructure 📡 C-bug 🐞
Difficulty 4/5 3-5 days Newbie friendliness 35/100
All issues in rust-lang/crates.io
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100