Browse Source

Set hashedKey to unique

pull/4103/head
Thomas Kaul 9 months ago
parent
commit
a4d4bf611c
  1. 5
      prisma/migrations/20241207142023_set_hashed_key_of_api_key_to_unique/migration.sql
  2. 3
      prisma/schema.prisma

5
prisma/migrations/20241207142023_set_hashed_key_of_api_key_to_unique/migration.sql

@ -0,0 +1,5 @@
-- DropIndex
DROP INDEX "ApiKey_hashedKey_idx";
-- CreateIndex
CREATE UNIQUE INDEX "ApiKey_hashedKey_key" ON "ApiKey"("hashedKey");

3
prisma/schema.prisma

@ -79,13 +79,12 @@ model Analytics {
model ApiKey {
createdAt DateTime @default(now())
hashedKey String
hashedKey String @unique
id String @id @default(uuid())
updatedAt DateTime @updatedAt
userId String
user User @relation(fields: [userId], onDelete: Cascade, references: [id])
@@index([hashedKey])
@@index([userId])
}

Loading…
Cancel
Save