aliabbasrizvi
aliabbasrizvi
PPrisma
Created by aliabbasrizvi on 7/3/2024 in #help-and-questions
Can I opt into join vs every query being join by default?
ok
6 replies
PPrisma
Created by aliabbasrizvi on 7/3/2024 in #help-and-questions
Can I opt into join vs every query being join by default?
I wish to have the ability to be able to set default behavior at start and then opt into the new join strategy
6 replies
PPrisma
Created by aliabbasrizvi on 7/3/2024 in #help-and-questions
Can I opt into join vs every query being join by default?
In understand this, but the problem is that if you have a 100 queries and you want to start trying the feature for only 2 queries say then you would have to update the code for 98 queries
6 replies
PPrisma
Created by aliabbasrizvi on 7/3/2024 in #help-and-questions
Problem with nested create
Schema:
model DocGeneration {
id String @id
userId String @map("user_id")
workspaceId String @map("workspace_id")
user User @relation(fields: [userId], references: [id])
workspace Workspace @relation(fields: [workspaceId], references: [id])
createdTime DateTime @default(now()) @map("created_time")
updatedTime DateTime @updatedAt @map("updated_time")
draftInputId String? @unique @map("draft_input_id")
draftInput DocGenerateInput? @relation("DraftDocGenerateInput", fields: [draftInputId], references: [id])
docGenerateInputs DocGenerateInput[] @relation("AllDocGenerateInputs")

@@index([userId, workspaceId, updatedTime(sort: Desc)])
@@map("doc_generation")
}

model DocGenerateInput {
id String @id
docGenerationId String @map("doc_generation_id")
settings Json
docGeneration DocGeneration? @relation("AllDocGenerateInputs", fields: [docGenerationId], references: [id])
draftForDocGeneration DocGeneration? @relation("DraftDocGenerateInput")
createdTime DateTime @default(now()) @map("created_time")
updatedTime DateTime @updatedAt @map("updated_time")

@@index([docGenerationId])
@@map("doc_generate_input")
}
model DocGeneration {
id String @id
userId String @map("user_id")
workspaceId String @map("workspace_id")
user User @relation(fields: [userId], references: [id])
workspace Workspace @relation(fields: [workspaceId], references: [id])
createdTime DateTime @default(now()) @map("created_time")
updatedTime DateTime @updatedAt @map("updated_time")
draftInputId String? @unique @map("draft_input_id")
draftInput DocGenerateInput? @relation("DraftDocGenerateInput", fields: [draftInputId], references: [id])
docGenerateInputs DocGenerateInput[] @relation("AllDocGenerateInputs")

@@index([userId, workspaceId, updatedTime(sort: Desc)])
@@map("doc_generation")
}

model DocGenerateInput {
id String @id
docGenerationId String @map("doc_generation_id")
settings Json
docGeneration DocGeneration? @relation("AllDocGenerateInputs", fields: [docGenerationId], references: [id])
draftForDocGeneration DocGeneration? @relation("DraftDocGenerateInput")
createdTime DateTime @default(now()) @map("created_time")
updatedTime DateTime @updatedAt @map("updated_time")

@@index([docGenerationId])
@@map("doc_generate_input")
}
2 replies