We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
https://www.prisma.io/docs/concepts/components/prisma-schema/relations/referential-actions
To delete a dataset, all the associated relations have to be deleted first, this can be specified in schema.prisma config.
schema.prisma
async function hard_delete(id) { const deleteFiles = prisma.dataset_file.deleteMany({ where: { dataset_id: id, }, }); const deleteWorkflows = prisma.workflow.deleteMany({ where: { dataset_id: id, }, }); const deleteAudit = prisma.dataset_audit.deleteMany({ where: { dataset_id: id, }, }); const deleteStates = prisma.dataset_state.deleteMany({ where: { dataset_id: id, }, }); const deleteAssociations = prisma.dataset_hierarchy.deleteMany({ where: { OR: [ { source_id: id, }, { derived_id: id, }, ], }, }); const deleteDataset = prisma.dataset.delete({ where: { id, }, }); await prisma.$transaction([ deleteFiles, deleteWorkflows, deleteAudit, deleteStates, deleteAssociations, deleteDataset, ]); }
The text was updated successfully, but these errors were encountered:
deepakduggirala
Successfully merging a pull request may close this issue.
https://www.prisma.io/docs/concepts/components/prisma-schema/relations/referential-actions
To delete a dataset, all the associated relations have to be deleted first, this can be specified in
schema.prisma
config.The text was updated successfully, but these errors were encountered: