Skip to content

Commit 1f4cf70

Browse files
committed
Add nulls last index to PlayerInfoGameType and PlayerInfoMap
1 parent 786ae3b commit 1f4cf70

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
-- DropIndex
2+
DROP INDEX "PlayerInfoGameType_gameTypeName_rating_idx";
3+
4+
-- DropIndex
5+
DROP INDEX "PlayerInfoMap_mapId_rating_idx";
6+
7+
-- CreateIndex
8+
CREATE INDEX "PlayerInfoGameType_gameTypeName_rating_playTime_idx" ON "PlayerInfoGameType"("gameTypeName", "rating" DESC NULLS LAST, "playTime" DESC);
9+
10+
-- CreateIndex
11+
CREATE INDEX "PlayerInfoMap_mapId_rating_playTime_idx" ON "PlayerInfoMap"("mapId", "rating" DESC NULLS LAST, "playTime" DESC);

libs/prisma/prisma/schema.prisma

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ model PlayerInfoGameType {
170170
gameTypeName String
171171
172172
@@unique([playerName, gameTypeName])
173-
@@index([gameTypeName, rating(sort: Desc, nulls: last)])
173+
@@index([gameTypeName, rating(sort: Desc, nulls: last), playTime(sort: Desc)])
174174
}
175175

176176
model PlayerInfoMap {
@@ -189,7 +189,7 @@ model PlayerInfoMap {
189189
190190
@@unique([playerName, mapId])
191191
@@index([playTime(sort: Desc)])
192-
@@index([mapId, rating(sort: Desc, nulls: last)])
192+
@@index([mapId, rating(sort: Desc, nulls: last), playTime(sort: Desc)])
193193
}
194194

195195
model GameServerClient {

0 commit comments

Comments
 (0)