diff --git a/packages/database/prisma/migrations/20240309043111_remove_poll_vote_index/migration.sql b/packages/database/prisma/migrations/20240309043111_remove_poll_vote_index/migration.sql new file mode 100644 index 000000000..41fae0416 --- /dev/null +++ b/packages/database/prisma/migrations/20240309043111_remove_poll_vote_index/migration.sql @@ -0,0 +1,2 @@ +-- DropIndex +DROP INDEX "votes_poll_id_idx"; diff --git a/packages/database/prisma/schema.prisma b/packages/database/prisma/schema.prisma index de90d0c13..8dd67ec8a 100644 --- a/packages/database/prisma/schema.prisma +++ b/packages/database/prisma/schema.prisma @@ -144,7 +144,6 @@ model Poll { participants Participant[] watchers Watcher[] comments Comment[] - votes Vote[] @@index([userId], type: Hash) @@map("polls") @@ -220,14 +219,12 @@ model Vote { participant Participant @relation(fields: [participantId], references: [id], onDelete: Cascade) participantId String @map("participant_id") optionId String @map("option_id") - poll Poll @relation(fields: [pollId], references: [id]) pollId String @map("poll_id") type VoteType @default(yes) createdAt DateTime @default(now()) @map("created_at") updatedAt DateTime? @updatedAt @map("updated_at") @@index([participantId], type: Hash) - @@index([pollId], type: Hash) @@map("votes") }