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
- Auto Updating Backend & Auth via Appwrit...
<@870607367597850624> Hey everyone 👋 I wanted to ask to ask for a friend, he’s asking if Appwrite be used in a similar way to Supabase when integrated with AI ...
- Is Database Operators available in Cloud...
Is it possible to do the above?
- How to use appwrite types
I am using appwrite types --language ts ./types to generate the types yielding something like: ``` import type { Models } from 'node-appwrite'; // This file i...