diff --git a/prisma/migrations/20221106203216_item_indices/migration.sql b/prisma/migrations/20221106203216_item_indices/migration.sql new file mode 100644 index 00000000..7cd5b493 --- /dev/null +++ b/prisma/migrations/20221106203216_item_indices/migration.sql @@ -0,0 +1,14 @@ +-- CreateIndex +CREATE INDEX "Item.weightedVotes_index" ON "Item"("weightedVotes"); + +-- CreateIndex +CREATE INDEX "Item.weightedDownVotes_index" ON "Item"("weightedDownVotes"); + +-- CreateIndex +CREATE INDEX "Item.bio_index" ON "Item"("bio"); + +-- CreateIndex +CREATE INDEX "Item.freebie_index" ON "Item"("freebie"); + +-- CreateIndex +CREATE INDEX "Item.sumVotes_index" ON "Item"(("weightedVotes" - "weightedDownVotes")); diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 8b4eeba8..1ad3d5f8 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -224,6 +224,10 @@ model Item { PollOption PollOption[] PollVote PollVote[] + @@index([weightedVotes]) + @@index([weightedDownVotes]) + @@index([bio]) + @@index([freebie]) @@index([createdAt]) @@index([userId]) @@index([parentId])