Skip to content

Commit 377993e

Browse files
committed
fix(prisma): add unique constraint to Chat model in Postgres
Generated migration to add unique index on instanceId and remoteJid.
1 parent df20c5f commit 377993e

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- AlterTable
2+
CREATE UNIQUE INDEX "Chat_instanceId_remoteJid_key" ON "Chat"("instanceId", "remoteJid");

prisma/postgresql-schema.prisma

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ model Chat {
132132
instanceId String
133133
unreadMessages Int @default(0)
134134
135+
@@unique([instanceId, remoteJid])
135136
@@index([instanceId])
136137
@@index([remoteJid])
137138
}

0 commit comments

Comments
 (0)