question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Questions around cascades and soft deletes

See original GitHub issue

Issue type:

[x] question [ ] bug report [ ] feature request [x] documentation issue

Database system/driver:

[ ] cordova [ ] mongodb [ ] mssql [ ] mysql / mariadb [ ] oracle [x] postgres [ ] cockroachdb [ ] sqlite [ ] sqljs [ ] react-native [ ] expo

TypeORM version:

[x] latest [ ] @next [ ] 0.x.x (or put your version here)

Question I have a couple questions around relation cascades that are not answered by the documentation.

  1. What’s the difference between setting cascade: "remove" and setting onDelete: "CASCADE"?
  2. Does setting onDelete: "CASCADE" cause soft deletes to cascade as well? or can that only be specified using the cascade option.
  3. Does cascade: "recover" mean that recovering a soft deleted object will cascade the recovery?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:9
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
imnotjamescommented, Jul 4, 2021

For questions, please check out the community slack or check TypeORM’s documentation page on other support avenues - cheers!

1reaction
jbjhjmcommented, Oct 13, 2021

Sorry @imnotjames, I have to disagree in this case. Documentation is very incomplete when it comes to cascades and what does what. Github issues is the #1 go-to knowledge base for everything that’s not documented, while community slack is all about individual issues and hard to use if you search for information.

Neither here, nor in the documentation, nor on discord was I able to find useful information on what the newer cascade types actually do. Guess I’m on my own here. Will try to pull to documentation if I find out how it is supposed to work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cascading soft-delete: best practice? #7846 - GitHub
So my question is: what's best practice here? I'm at a fairly early stage of this project, so a big refactor is much...
Read more >
Cascading Soft Delete - sql - Stack Overflow
I've come up with a solution to cascading soft-deletes recently using Postgres 9.6 that makes use of inheritance to partition entries into ...
Read more >
Disadvantages to using ON DELETE CASCADE on every ...
A thing to keep in mind when using cascades is that it can cause conflicts if there's multiple cascade paths. SQL Server and...
Read more >
To Delete or to Soft Delete, That is the Question! - Jmix
Soft delete is a widely used pattern used for business applications. ... Keeping reference integrity and avoid cascade delete; You need “Graceful” delete....
Read more >
Laravel Soft Delete Cascade - Laracasts
So if company is soft deleted, the 'deleting' event in the company model is hooked to also soft delete the domain(s) associated with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found