Skip to content

Commit

Permalink
include unique constraint on auth_id
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigotiscareno committed Aug 4, 2024
1 parent 448fbe1 commit 85ee480
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,6 @@ CREATE TABLE "users" (

CONSTRAINT "users_pkey" PRIMARY KEY ("id")
);

-- CreateIndex
CREATE UNIQUE INDEX "users_auth_id_key" ON "users"("auth_id");
2 changes: 1 addition & 1 deletion backend/typescript/models/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ model users {
id Int @id @default(autoincrement())
first_name String @db.VarChar(255)
last_name String @db.VarChar(255)
auth_id String @db.VarChar(255)
auth_id String @unique @db.VarChar(255)
role enum_users_role
createdAt DateTime? @db.Timestamptz(6)
updatedAt DateTime? @db.Timestamptz(6)
Expand Down

0 comments on commit 85ee480

Please sign in to comment.