mirror of
https://github.com/documenso/documenso.git
synced 2025-11-26 22:44:41 +10:00
perf: add database indexes for insights queries (#2211)
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
-- CreateIndex
|
||||
CREATE INDEX "Envelope_type_idx" ON "Envelope"("type");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "Envelope_status_idx" ON "Envelope"("status");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "Envelope_createdAt_idx" ON "Envelope"("createdAt");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "Organisation_name_idx" ON "Organisation"("name");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "Organisation_ownerUserId_idx" ON "Organisation"("ownerUserId");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "OrganisationMember_organisationId_idx" ON "OrganisationMember"("organisationId");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "Recipient_email_idx" ON "Recipient"("email");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "Recipient_signedAt_idx" ON "Recipient"("signedAt");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "Team_name_idx" ON "Team"("name");
|
||||
@@ -430,9 +430,12 @@ model Envelope {
|
||||
|
||||
envelopeAttachments EnvelopeAttachment[]
|
||||
|
||||
@@index([folderId])
|
||||
@@index([teamId])
|
||||
@@index([type])
|
||||
@@index([status])
|
||||
@@index([userId])
|
||||
@@index([teamId])
|
||||
@@index([folderId])
|
||||
@@index([createdAt])
|
||||
}
|
||||
|
||||
model EnvelopeItem {
|
||||
@@ -583,8 +586,10 @@ model Recipient {
|
||||
fields Field[]
|
||||
signatures Signature[]
|
||||
|
||||
@@index([envelopeId])
|
||||
@@index([token])
|
||||
@@index([email])
|
||||
@@index([envelopeId])
|
||||
@@index([signedAt])
|
||||
}
|
||||
|
||||
enum FieldType {
|
||||
@@ -694,6 +699,9 @@ model Organisation {
|
||||
|
||||
organisationAuthenticationPortalId String @unique
|
||||
organisationAuthenticationPortal OrganisationAuthenticationPortal @relation(fields: [organisationAuthenticationPortalId], references: [id])
|
||||
|
||||
@@index([name])
|
||||
@@index([ownerUserId])
|
||||
}
|
||||
|
||||
model OrganisationMember {
|
||||
@@ -710,6 +718,7 @@ model OrganisationMember {
|
||||
organisationGroupMembers OrganisationGroupMember[]
|
||||
|
||||
@@unique([userId, organisationId])
|
||||
@@index([organisationId])
|
||||
}
|
||||
|
||||
model OrganisationMemberInvite {
|
||||
@@ -883,6 +892,7 @@ model Team {
|
||||
teamGlobalSettingsId String @unique
|
||||
teamGlobalSettings TeamGlobalSettings @relation(fields: [teamGlobalSettingsId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@index([name])
|
||||
@@index([organisationId])
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user