parent
44191e79a1
commit
e5ca77eb93
|
@ -0,0 +1,14 @@
|
|||
/*
|
||||
Warnings:
|
||||
|
||||
- The primary key for the `Membership` table will be changed. If it partially fails, the table could be left without primary key constraint.
|
||||
- A unique constraint covering the columns `[userId,teamId]` on the table `Membership` will be added. If there are existing duplicate values, this will fail.
|
||||
|
||||
*/
|
||||
-- AlterTable
|
||||
ALTER TABLE "Membership" DROP CONSTRAINT "Membership_pkey",
|
||||
ADD COLUMN "id" SERIAL NOT NULL,
|
||||
ADD CONSTRAINT "Membership_pkey" PRIMARY KEY ("id");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "Membership_userId_teamId_key" ON "Membership"("userId", "teamId");
|
|
@ -284,6 +284,7 @@ enum MembershipRole {
|
|||
}
|
||||
|
||||
model Membership {
|
||||
id Int @id @default(autoincrement())
|
||||
teamId Int
|
||||
userId Int
|
||||
accepted Boolean @default(false)
|
||||
|
@ -292,7 +293,7 @@ model Membership {
|
|||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
disableImpersonation Boolean @default(false)
|
||||
|
||||
@@id([userId, teamId])
|
||||
@@unique([userId, teamId])
|
||||
@@index([teamId])
|
||||
@@index([userId])
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue