From 9431469453a9317198ae5563ef65e7161092c58d Mon Sep 17 00:00:00 2001 From: keyan Date: Sun, 6 Nov 2022 14:39:23 -0600 Subject: [PATCH] more indices --- .../20221106203216_item_indices/migration.sql | 14 ++++++++++++++ prisma/schema.prisma | 4 ++++ 2 files changed, 18 insertions(+) create mode 100644 prisma/migrations/20221106203216_item_indices/migration.sql 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])