-
Notifications
You must be signed in to change notification settings - Fork 856
Update referential integrity and referential actions documentation #2581
New issue
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, so we need to be extremely clear with what these terms mean. First let's talk about the referential integrity: It's a promise the database gives to the user, that we do not break relationships when modifying our data. The database uses a few tools to implement this, one of them is the foreign key constraint that stops you from modifying things that might break relations, and the other is the referential action that is an addition to the constraint that can trigger additional queries in the database transaction before the actual item gets deleted.
How Prisma's Query Core implements the referential integrity is through a set of referential actions. In our case, using NoAction means we break the referential integrity, and the user can modify things that break relations. We should be clear on this and maybe communicate with the client team to see do we pursue with only the actions, or should we also implement the constraint part.
content/200-concepts/100-components/01-prisma-schema/06-relations/420-referential-integrity.mdx
Outdated
Show resolved
Hide resolved
content/200-concepts/100-components/01-prisma-schema/06-relations/420-referential-integrity.mdx
Outdated
Show resolved
Hide resolved
.../200-concepts/100-components/01-prisma-schema/06-relations/425-referential-actions/index.mdx
Outdated
Show resolved
Hide resolved
.../200-concepts/100-components/01-prisma-schema/06-relations/425-referential-actions/index.mdx
Outdated
Show resolved
Hide resolved
.../200-concepts/100-components/01-prisma-schema/06-relations/425-referential-actions/index.mdx
Show resolved
Hide resolved
…ons/420-referential-integrity.mdx Co-authored-by: Julius de Bruijn <bruijn@prisma.io>
content/200-concepts/100-components/01-prisma-schema/06-relations/420-referential-integrity.mdx
Outdated
Show resolved
Hide resolved
…ons/420-referential-integrity.mdx Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com>
content/200-concepts/100-components/01-prisma-schema/06-relations/420-referential-integrity.mdx
Outdated
Show resolved
Hide resolved
content/200-concepts/100-components/01-prisma-schema/06-relations/420-referential-integrity.mdx
Outdated
Show resolved
Hide resolved
content/200-concepts/100-components/01-prisma-schema/06-relations/420-referential-integrity.mdx
Outdated
Show resolved
Hide resolved
content/200-concepts/100-components/01-prisma-schema/06-relations/420-referential-integrity.mdx
Outdated
Show resolved
Hide resolved
content/200-concepts/100-components/01-prisma-schema/06-relations/420-referential-integrity.mdx
Outdated
Show resolved
Hide resolved
content/200-concepts/100-components/01-prisma-schema/06-relations/420-referential-integrity.mdx
Outdated
Show resolved
Hide resolved
content/200-concepts/100-components/01-prisma-schema/06-relations/420-referential-integrity.mdx
Outdated
Show resolved
Hide resolved
content/200-concepts/100-components/01-prisma-schema/06-relations/420-referential-integrity.mdx
Show resolved
Hide resolved
content/200-concepts/100-components/01-prisma-schema/06-relations/420-referential-integrity.mdx
Outdated
Show resolved
Hide resolved
content/200-concepts/100-components/01-prisma-schema/06-relations/420-referential-integrity.mdx
Outdated
Show resolved
Hide resolved
content/200-concepts/100-components/01-prisma-schema/06-relations/420-referential-integrity.mdx
Outdated
Show resolved
Hide resolved
.../200-concepts/100-components/01-prisma-schema/06-relations/425-referential-actions/index.mdx
Outdated
Show resolved
Hide resolved
.../200-concepts/100-components/01-prisma-schema/06-relations/425-referential-actions/index.mdx
Show resolved
Hide resolved
.../200-concepts/100-components/01-prisma-schema/06-relations/425-referential-actions/index.mdx
Outdated
Show resolved
Hide resolved
.../200-concepts/100-components/01-prisma-schema/06-relations/425-referential-actions/index.mdx
Outdated
Show resolved
Hide resolved
.../200-concepts/100-components/01-prisma-schema/06-relations/425-referential-actions/index.mdx
Outdated
Show resolved
Hide resolved
…ons/420-referential-integrity.mdx Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com>
…ons/420-referential-integrity.mdx Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com>
…ons/425-referential-actions/index.mdx Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com>
content/200-concepts/100-components/01-prisma-schema/06-relations/420-referential-integrity.mdx
Outdated
Show resolved
Hide resolved
content/200-concepts/100-components/01-prisma-schema/06-relations/420-referential-integrity.mdx
Outdated
Show resolved
Hide resolved
…ons/420-referential-integrity.mdx Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com>
…ons/420-referential-integrity.mdx Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com>
content/200-concepts/100-components/01-prisma-schema/06-relations/420-referential-integrity.mdx
Show resolved
Hide resolved
content/200-concepts/100-components/01-prisma-schema/06-relations/420-referential-integrity.mdx
Show resolved
Hide resolved
content/200-concepts/100-components/01-prisma-schema/06-relations/420-referential-integrity.mdx
Outdated
Show resolved
Hide resolved
content/200-concepts/100-components/01-prisma-schema/06-relations/420-referential-integrity.mdx
Show resolved
Hide resolved
content/200-concepts/100-components/01-prisma-schema/06-relations/420-referential-integrity.mdx
Show resolved
Hide resolved
.../200-concepts/100-components/01-prisma-schema/06-relations/425-referential-actions/index.mdx
Show resolved
Hide resolved
.../200-concepts/100-components/01-prisma-schema/06-relations/425-referential-actions/index.mdx
Show resolved
Hide resolved
.../200-concepts/100-components/01-prisma-schema/06-relations/425-referential-actions/index.mdx
Show resolved
Hide resolved
.../200-concepts/100-components/01-prisma-schema/06-relations/425-referential-actions/index.mdx
Show resolved
Hide resolved
.../200-concepts/100-components/01-prisma-schema/06-relations/425-referential-actions/index.mdx
Show resolved
Hide resolved
|
✔️ Deploy Preview for prisma2-docs ready! 🔨 Explore the source changes: da84bc1 🔍 Inspect the deploy log: https://app.netlify.com/sites/prisma2-docs/deploys/61c04dda747853000732af5a 😎 Browse the preview: https://deploy-preview-2581--prisma2-docs.netlify.app |
Reword opening paragraph
.../200-concepts/100-components/01-prisma-schema/06-relations/425-referential-actions/index.mdx
Outdated
Show resolved
Hide resolved
.../200-concepts/100-components/01-prisma-schema/06-relations/425-referential-actions/index.mdx
Outdated
Show resolved
Hide resolved
.../200-concepts/100-components/01-prisma-schema/06-relations/425-referential-actions/index.mdx
Outdated
Show resolved
Hide resolved
content/200-concepts/100-components/01-prisma-schema/06-relations/420-referential-integrity.mdx
Outdated
Show resolved
Hide resolved
…ons/425-referential-actions/index.mdx Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com>
…ons/420-referential-integrity.mdx Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com>
…ons/425-referential-actions/index.mdx Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com>
…eferential emulation
Have addressed now as part of other review comments
…2581) * Initial update to referential integrity documentation * Add admonition for referential emulation * Update content/200-concepts/100-components/01-prisma-schema/06-relations/420-referential-integrity.mdx Co-authored-by: Julius de Bruijn <bruijn@prisma.io> * Remove SQL tab * Update with correct current support level for Mongo * Update content/200-concepts/100-components/01-prisma-schema/06-relations/420-referential-integrity.mdx Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com> * Update content/200-concepts/100-components/01-prisma-schema/06-relations/420-referential-integrity.mdx Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com> * Update content/200-concepts/100-components/01-prisma-schema/06-relations/420-referential-integrity.mdx Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com> * Update content/200-concepts/100-components/01-prisma-schema/06-relations/425-referential-actions/index.mdx Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com> * Update following review comments * Update content/200-concepts/100-components/01-prisma-schema/06-relations/420-referential-integrity.mdx Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com> * Update content/200-concepts/100-components/01-prisma-schema/06-relations/420-referential-integrity.mdx Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com> * Clarify introspection behaviour with referential emulation * Make copyedit changes to referential integrity * Make copyedit changes to referential actions page * Move warning to referential actions page * Update 420-referential-integrity.mdx Reword opening paragraph * Update content/200-concepts/100-components/01-prisma-schema/06-relations/425-referential-actions/index.mdx Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com> * Update content/200-concepts/100-components/01-prisma-schema/06-relations/420-referential-integrity.mdx Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com> * Update content/200-concepts/100-components/01-prisma-schema/06-relations/425-referential-actions/index.mdx Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com> * Clarify raw queries not triggering actions as current limitation of referential emulation * Fix typo * Add caveat on constraints back to referential integrity page Co-authored-by: Julius de Bruijn <bruijn@prisma.io> Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com>
…2581) * Initial update to referential integrity documentation * Add admonition for referential emulation * Update content/200-concepts/100-components/01-prisma-schema/06-relations/420-referential-integrity.mdx Co-authored-by: Julius de Bruijn <bruijn@prisma.io> * Remove SQL tab * Update with correct current support level for Mongo * Update content/200-concepts/100-components/01-prisma-schema/06-relations/420-referential-integrity.mdx Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com> * Update content/200-concepts/100-components/01-prisma-schema/06-relations/420-referential-integrity.mdx Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com> * Update content/200-concepts/100-components/01-prisma-schema/06-relations/420-referential-integrity.mdx Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com> * Update content/200-concepts/100-components/01-prisma-schema/06-relations/425-referential-actions/index.mdx Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com> * Update following review comments * Update content/200-concepts/100-components/01-prisma-schema/06-relations/420-referential-integrity.mdx Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com> * Update content/200-concepts/100-components/01-prisma-schema/06-relations/420-referential-integrity.mdx Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com> * Clarify introspection behaviour with referential emulation * Make copyedit changes to referential integrity * Make copyedit changes to referential actions page * Move warning to referential actions page * Update 420-referential-integrity.mdx Reword opening paragraph * Update content/200-concepts/100-components/01-prisma-schema/06-relations/425-referential-actions/index.mdx Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com> * Update content/200-concepts/100-components/01-prisma-schema/06-relations/420-referential-integrity.mdx Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com> * Update content/200-concepts/100-components/01-prisma-schema/06-relations/425-referential-actions/index.mdx Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com> * Clarify raw queries not triggering actions as current limitation of referential emulation * Fix typo * Add caveat on constraints back to referential integrity page Co-authored-by: Julius de Bruijn <bruijn@prisma.io> Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com>
Describe this PR
I've made initial changes to the referential integrity and referential actions docs based on conversations with @tanberry, @pimeys and @dpetrick yesterday. At the moment this is mainly getting up-to-date information in there - we still need to make the organisation of the pages as a whole better.
Comments welcome!
Changes
What issue does this fix?
WIP for issue #2538
Any other relevant information