chore: add indexes for user delete (#24740)
* chore: Adding indexes for user delete cascade * Add comments to indicate a partial index has been added on a field --------- Co-authored-by: Morgan <33722304+ThyMinimalDev@users.noreply.github.com>
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
CREATE INDEX "Booking_reassignById_idx" ON "Booking"("reassignById")
|
||||
WHERE "reassignById" IS NOT NULL;
|
||||
|
||||
CREATE INDEX "EventType_instantMeetingScheduleId_idx" ON "EventType"("instantMeetingScheduleId")
|
||||
WHERE "instantMeetingScheduleId" IS NOT NULL;
|
||||
|
||||
CREATE INDEX "CreditExpenseLog_bookingUid_idx" ON "CreditExpenseLog"("bookingUid")
|
||||
WHERE "bookingUid" IS NOT NULL;
|
||||
|
||||
CREATE INDEX "WebhookScheduledTriggers_bookingId_idx" ON "WebhookScheduledTriggers"("bookingId")
|
||||
WHERE "bookingId" IS NOT NULL;
|
||||
@@ -244,6 +244,8 @@ model EventType {
|
||||
createdAt DateTime? @default(now())
|
||||
updatedAt DateTime? @updatedAt
|
||||
|
||||
// @@partial_index([instantMeetingScheduleId])
|
||||
|
||||
@@unique([userId, slug])
|
||||
@@unique([teamId, slug])
|
||||
@@unique([userId, parentId])
|
||||
@@ -640,6 +642,8 @@ model CreditExpenseLog {
|
||||
callDuration Int?
|
||||
creditFor CreditUsageType?
|
||||
externalRef String? @unique
|
||||
|
||||
// @@partial_index([bookingUid])
|
||||
}
|
||||
|
||||
enum CreditType {
|
||||
@@ -852,6 +856,8 @@ model Booking {
|
||||
expenseLogs CreditExpenseLog[]
|
||||
report BookingReport?
|
||||
|
||||
// @@partial_index([reassignById])
|
||||
|
||||
@@index([eventTypeId])
|
||||
@@index([userId])
|
||||
@@index([destinationCalendarId])
|
||||
@@ -1575,6 +1581,8 @@ model WebhookScheduledTriggers {
|
||||
webhook Webhook? @relation(fields: [webhookId], references: [id], onDelete: Cascade)
|
||||
bookingId Int?
|
||||
booking Booking? @relation(fields: [bookingId], references: [id], onDelete: Cascade)
|
||||
|
||||
// @@partial_index([bookingId])
|
||||
}
|
||||
|
||||
enum WorkflowTemplates {
|
||||
|
||||
Reference in New Issue
Block a user