Skip to content

Commit 184a502

Browse files
author
Jeff Yanta
committed
database: add (chatId, id) index on messages table
1 parent c034cb3 commit 184a502

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+
-- CreateIndex
2+
CREATE INDEX "flipchat_messages_chatId_id_idx" ON "flipchat_messages"("chatId", "id" ASC);

database/prisma/schema.prisma

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ model Message {
165165
166166
// Constraints
167167
168+
@@index([chatId, id(sort: Asc)])
168169
@@map("flipchat_messages")
169170
}
170171

0 commit comments

Comments
 (0)