Questions around cascades and soft deletes
See original GitHub issueIssue 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.
- What’s the difference between setting
cascade: "remove"
and settingonDelete: "CASCADE"
? - Does setting
onDelete: "CASCADE"
cause soft deletes to cascade as well? or can that only be specified using thecascade
option. - Does
cascade: "recover"
mean that recovering a soft deleted object will cascade the recovery?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:9
- Comments:8 (6 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
For questions, please check out the community slack or check TypeORM’s documentation page on other support avenues - cheers!
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.