Skip to content

chore(be): remove unique from nickname#3575

Open
zero1177 wants to merge 2 commits into
feat/remove-whitelistfrom
chore/modify-schema
Open

chore(be): remove unique from nickname#3575
zero1177 wants to merge 2 commits into
feat/remove-whitelistfrom
chore/modify-schema

Conversation

@zero1177
Copy link
Copy Markdown
Contributor

Description

nickname 필드 @unique 삭제

@zero1177 zero1177 requested review from juheon429 and nhjbest22 May 22, 2026 11:13
@zero1177 zero1177 self-assigned this May 22, 2026
Copilot AI review requested due to automatic review settings May 22, 2026 11:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 @unique from User.nickname in schema.prisma.
  • Add a Prisma migration that drops the existing unique index user_nickname_key on public.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.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

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?
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

닉네임의 @unique 제약 조건을 제거하면 중복 사용이 가능해져 사칭(impersonation) 위험이 생길 수 있습니다. UI에서 고유 식별자(예: username)를 병행 표기하는 등의 보완책을 검토해 주세요. 또한, 제약 조건 삭제 시 인덱스도 함께 제거되므로, 해당 필드를 검색에 자주 사용한다면 @@index([nickname]) 추가를 고려해 보시기 바랍니다.

Copy link
Copy Markdown
Contributor

@Choi-Jung-Hyeon Choi-Jung-Hyeon left a comment

Choose a reason for hiding this comment

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

LGTM~! 바로 머지해도 될듯?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants