2
0

refactor(db): 🗃️ Add custom domain primary key

This commit is contained in:
Baptiste Arnaud
2022-03-22 07:43:00 +01:00
parent b2bf6f09f6
commit a533552b40
2 changed files with 6 additions and 1 deletions

View File

@ -0,0 +1,5 @@
-- DropIndex
DROP INDEX "CustomDomain_name_key";
-- AlterTable
ALTER TABLE "CustomDomain" ADD CONSTRAINT "CustomDomain_pkey" PRIMARY KEY ("name");

View File

@ -59,10 +59,10 @@ model User {
} }
model CustomDomain { model CustomDomain {
name String @id
createdAt DateTime @default(now()) createdAt DateTime @default(now())
ownerId String ownerId String
owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade) owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
name String @unique
} }
model Credentials { model Credentials {