docs icon indicating copy to clipboard operation
docs copied to clipboard

Consider removing the "Cascading deletes"-guides

Open nikolasburk opened this issue 3 years ago • 3 comments

We have these guides in our docs:

  • https://www.prisma.io/docs/guides/database/advanced-database-tasks/cascading-deletes/postgresql
  • https://www.prisma.io/docs/guides/database/advanced-database-tasks/cascading-deletes/mysql
  • https://www.prisma.io/docs/guides/database/advanced-database-tasks/cascading-deletes/sqlite

I would consider removing them (or maybe moving them to the Data Guide) for these reasons:

  • These guides were written because Prisma didn't support cascading deletes natively so we needed a resource to point people to if they still wanted to use them that explained a workaround with plain SQL, now that we have proper docs, these workarounds don't seem needed any more.
  • Most users won't think of this feature as "referential actions" but as "cascading deletes/updates"; when searching for cascading in the docs, the first results that come up are the guides and not the new docs pages

Andrew: I'm in favour of completely removing the pages, from the principal of lean docs. If Prisma now does this natively, then I don't think we need to document workarounds.

But we do have links to them that we'll need to remove. I need to check that it's OK to remove each of these. In particular, it might be that this workaround is still relevant to earlier versions of Prisma, so we might actually want to keep the pages for now. We could also move the pages to the data guide, as Nikolas suggests, and change the links to point there. I will need to think about/investigate this.

References to these pages in our docs:

  • concepts/components/prisma-schema/relations/referential-actions/_index (two mentions) - links from delete() and deleteAll() - can we remove?

    • Also links to: https://www.prisma.io/docs/concepts/components/prisma-schema/relations/referential-actions#how-to-use-cascading-deletes
  • https://www.prisma.io/docs/concepts/components/prisma-migrate/legacy-migrate#supported-operations Link to workaround - can we remove it?

  • https://www.prisma.io/docs/guides/performance-and-optimization/prisma-client-transactions-guide#are-cascading-deletes-supported-by-the-prisma-client-nested-writes

  • https://www.prisma.io/docs/guides/upgrade-guides/upgrading-versions/upgrading-to-prisma-3/referential-actions#using-introspection - same links as in first item in this list

Unambiguously OK to remove:

  • _redirects (two mentions)

Current status: done and merged. I concluded that we couldn't remove these docs, but I've mitigated the issue by adding better signposting to the various pages involved.

nikolasburk avatar Dec 21 '21 09:12 nikolasburk

I just searched for "unique" in the docs and the DB workflows about UNIQUE constraints came up first in the search:

image

That's not ideal because these guides show how to define UNIQUE constraints in SQL. These guides were written before Prisma Migrate was ready and it wasn't possible to define UNIQUE constraints via the Prisma data model. I think this is a similar case as the cascading delete guides and we should consider removing these guides.

nikolasburk avatar Jul 04 '22 09:07 nikolasburk

The guides are still present.

janpio avatar Jul 29 '22 23:07 janpio

The guides are still present.

Yes, we decided to keep them for now, because the docs are still relevant to users on older versions. The problem is not the existence of the cascading deletes guides per se, but that they are too prominent in the search results, and it is hard for users on newer versions to get to the referential actions page. We therefore put in more cross-linking and signposting to help users get to the right docs.

I made these changes in https://github.com/prisma/docs/pull/3445.

andrew-walford-prisma avatar Aug 08 '22 10:08 andrew-walford-prisma

The guides have been removed from the docs. Feel free to reopen if they're still present

ruheni avatar Apr 28 '23 09:04 ruheni