add unique constraint on appointments

This commit is contained in:
OxSaitama 2023-07-26 11:53:20 +02:00
parent e9f3fb7e9c
commit d244158c4e
2 changed files with 9 additions and 0 deletions

View File

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

View File

@ -297,6 +297,7 @@ model Appointments {
status EAppointmentStatus @default(OPEN)
votes Votes[]
@@unique([user_uid, choice, status])
@@map("appointments")
}