unique制約追加

This commit is contained in:
ろむねこ 2024-06-19 15:31:58 +09:00
parent 0fae9ff7cd
commit 734ff66574
Signed by: Fujimatsu
GPG Key ID: FA1F39A1BA37D168
2 changed files with 9 additions and 1 deletions

View File

@ -0,0 +1,8 @@
/*
Warnings:
- A unique constraint covering the columns `[code]` on the table `ActiveLoginCode` will be added. If there are existing duplicate values, this will fail.
*/
-- CreateIndex
CREATE UNIQUE INDEX "ActiveLoginCode_code_key" ON "ActiveLoginCode"("code");

View File

@ -76,7 +76,7 @@ model TaskChildLinkage {
model ActiveLoginCode {
id String @id @default(cuid())
child_id String
code Int
code Int @unique
created_at DateTime @default(now())
child Child @relation(fields: [child_id], references: [id])
}