feat: add database indexes for frequent query patterns

This commit is contained in:
2026-05-16 16:57:23 +08:00
parent 6737761151
commit 3388bf42b5
5 changed files with 15 additions and 2 deletions
+5 -1
View File
@@ -1,5 +1,6 @@
import {
boolean,
index,
pgTable,
text,
timestamp,
@@ -21,5 +22,8 @@ export const gameVersions = pgTable(
isLatest: boolean("is_latest").default(false).notNull(),
createdAt: timestamp("created_at").defaultNow().notNull(),
},
(table) => [unique("game_build_unique").on(table.gameId, table.buildId)]
(table) => [
unique("game_build_unique").on(table.gameId, table.buildId),
index("perf_game_lookup_idx").on(table.gameId),
]
)