diff --git a/packages/db/prisma/migrations/20221020070814_remove_duplicate_answer_index/migration.sql b/packages/db/prisma/migrations/20221020070814_remove_duplicate_answer_index/migration.sql new file mode 100644 index 000000000..8eb4e8100 --- /dev/null +++ b/packages/db/prisma/migrations/20221020070814_remove_duplicate_answer_index/migration.sql @@ -0,0 +1,2 @@ +-- DropIndex +DROP INDEX "Answer_resultId_idx"; diff --git a/packages/db/prisma/migrations/20221020070833_add_typebot_id_index_in_result/migration.sql b/packages/db/prisma/migrations/20221020070833_add_typebot_id_index_in_result/migration.sql new file mode 100644 index 000000000..36d8fbfdd --- /dev/null +++ b/packages/db/prisma/migrations/20221020070833_add_typebot_id_index_in_result/migration.sql @@ -0,0 +1,2 @@ +-- CreateIndex +CREATE INDEX CONCURRENTLY "Result_typebotId_idx" ON "Result"("typebotId"); diff --git a/packages/db/prisma/schema.prisma b/packages/db/prisma/schema.prisma index 1405b4814..8fb454247 100644 --- a/packages/db/prisma/schema.prisma +++ b/packages/db/prisma/schema.prisma @@ -217,6 +217,8 @@ model Result { typebot Typebot @relation(fields: [typebotId], references: [id], onDelete: Cascade) answers Answer[] logs Log[] + + @@index([typebotId]) } model Log { @@ -242,7 +244,6 @@ model Answer { result Result @relation(fields: [resultId], references: [id], onDelete: Cascade) @@unique([resultId, blockId, groupId]) - @@index([resultId]) } model Coupon {