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
+2
View File
@@ -1,4 +1,5 @@
import {
index,
text,
pgEnum,
pgTable,
@@ -37,4 +38,5 @@ export const reports = pgTable("reports", {
createdAt: timestamp("created_at").defaultNow().notNull(),
}, (table) => [
uniqueIndex("reports_entry_reporter_unique").on(table.entryId, table.reporterId),
index("reports_status_idx").on(table.status),
])