chore(be): remove unique from nickname#3575
Conversation
There was a problem hiding this comment.
Pull request overview
Removes the uniqueness constraint from the User.nickname field in the backend Prisma schema, allowing multiple users to share the same (non-null) nickname.
Changes:
- Remove
@uniquefromUser.nicknameinschema.prisma. - Add a Prisma migration that drops the existing unique index
user_nickname_keyonpublic.user(nickname).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| apps/backend/prisma/schema.prisma | Removes the @unique attribute from User.nickname. |
| apps/backend/prisma/migrations/20260522111225_remove_unique_constraint_from_nickname/migration.sql | Drops the user_nickname_key unique index to match the schema change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Code Review
This pull request removes the unique constraint from the nickname field in the User model and includes a database migration to drop the corresponding index. The reviewer noted that allowing duplicate nicknames could lead to impersonation risks and suggested adding a non-unique index if the field is frequently used for searches to maintain performance.
| role Role @default(User) | ||
| jobType JobType @default(CollegeStudent) @map("job_type") | ||
| nickname String? @unique | ||
| nickname String? |
Choi-Jung-Hyeon
left a comment
There was a problem hiding this comment.
LGTM~! 바로 머지해도 될듯?
Description
nickname 필드 @unique 삭제