🗃 Improve usage queries
This commit is contained in:
@ -196,6 +196,7 @@ model Typebot {
|
||||
|
||||
@@index([workspaceId])
|
||||
@@index([folderId])
|
||||
@@index([isArchived, createdAt(sort: Desc)])
|
||||
}
|
||||
|
||||
model Invitation {
|
||||
@ -249,7 +250,8 @@ model Result {
|
||||
answers Answer[]
|
||||
logs Log[]
|
||||
|
||||
@@index([typebotId])
|
||||
@@index([typebotId, hasStarted, createdAt(sort: Desc)])
|
||||
@@index([typebotId, isCompleted])
|
||||
}
|
||||
|
||||
model Log {
|
||||
@ -270,12 +272,13 @@ model Answer {
|
||||
blockId String
|
||||
groupId String
|
||||
variableId String?
|
||||
content String
|
||||
content String @db.Text
|
||||
storageUsed Int?
|
||||
result Result @relation(fields: [resultId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@unique([resultId, blockId, groupId])
|
||||
@@index([groupId])
|
||||
@@index([storageUsed])
|
||||
}
|
||||
|
||||
model Coupon {
|
||||
|
@ -179,6 +179,7 @@ model Typebot {
|
||||
isClosed Boolean @default(false)
|
||||
|
||||
@@index([workspaceId])
|
||||
@@index([isArchived, createdAt(sort: Desc)])
|
||||
}
|
||||
|
||||
model Invitation {
|
||||
@ -230,7 +231,8 @@ model Result {
|
||||
answers Answer[]
|
||||
logs Log[]
|
||||
|
||||
@@index([typebotId])
|
||||
@@index([typebotId, hasStarted, createdAt(sort: Desc)])
|
||||
@@index([typebotId, isCompleted])
|
||||
}
|
||||
|
||||
model Log {
|
||||
@ -257,6 +259,7 @@ model Answer {
|
||||
|
||||
@@unique([resultId, blockId, groupId])
|
||||
@@index([groupId])
|
||||
@@index([storageUsed])
|
||||
}
|
||||
|
||||
model Coupon {
|
||||
|
Reference in New Issue
Block a user