Hiya, I have quite few instances in my schema with...
# orm-help
t
Hiya, I have quite few instances in my schema with 1-1 relationships between two models where I want to ensure that the creation of A requires the creation of B (so primary key is going to be on A's side, and non-nullable), but I also want to cascade delete B if A is deleted - is this possible in any way? For example if I have
Copy code
model User {
	...
    profile   Profile @relation(fields: [profileID], references: [id])
    profileID Int     @unique
}

model Profile {
    ...
    user User?
}
I'm ensuring I can't create a User without a Profile, but that way a Profile won't get deleted if a User is deleted, right? Currently I have it the other way around so I get the cascades but then I can't require the creation of the Profile, which I'd really like to be able to do as I have a bunch of structures like this. Cheers
1
Oh I'm sorry, just found this post, managed to miss it completely