
Hello, I have a parent table called asset
and a child table called user
. user
table has a 1-1 relationship with asset
as 1 user can only use 1 asset. And 1 asset can only belong to 1 user.
The thing is, at the point of asset creation, it is possible that there is no user yet until after some times, which means user
could potentially be empty for a long time.
Now, I want to set up a relationship such that if I delete an asset
, it will delete the user
too. I have set up the relationship as Cascade. But, I noticed that when I delete the user
, it also deletes the asset
, which I don't want.
How do I set it such that:
- If I delete
asset
, it deletes its associateduser
- If I delete
user
, nothing happens toasset
Recommended threads
- Creating a relationship with nested obje...
{ "data": { "name": "DiDi", "type": "Software Development", "userJobs": [{ "$id": "68cbf1e2003612fb13ca", "j...
- Realtime integration with SSR auth
Hey, I have a nextjs website with SSR auth, works great. I use a session client for user verification and an admin client with API key. Both is used with node-...
- Adding "name" column to table creates 2-...
As stated, im adding the "name" column to one table, it adds 4 duplicates. In another table it adds 3 duplicates, and when I delete 1 of them, all duplucates di...
