diff --git a/prisma/migrations/20260408160000_add_review_userid_index/migration.sql b/prisma/migrations/20260408160000_add_review_userid_index/migration.sql new file mode 100644 index 0000000..d3e532e --- /dev/null +++ b/prisma/migrations/20260408160000_add_review_userid_index/migration.sql @@ -0,0 +1,5 @@ +-- CreateIndex +-- Safe for production: CREATE INDEX CONCURRENTLY does not lock the table for writes. +-- Note: Prisma migrations do not support CONCURRENTLY natively. +-- For large tables, run this manually with CONCURRENTLY outside of a transaction. +CREATE INDEX "Review_userId_idx" ON "Review"("userId"); diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 0cb5acf..82f17a9 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -567,4 +567,5 @@ model Review { createdAt DateTime @default(now()) @@index([targetType, targetId]) + @@index([userId]) }