So if I have this Photos: [Media!]! in my schema,...
# orm-help
j
So if I have this Photos: [Media!]! in my schema, does it delete the Media when I delete the main schema? Photos is part of House. If I delete house, will photos delete too?
d
hey @Jscott388 take a look over here, there's a cascade deletion attribute on the @relation directive https://www.prisma.io/docs/1.0/reference/service-configuration/data-modelling-(sdl)-eiroozae8u/#the-@relation-directive
j
Do you have to give it a name or is that optional?
d
if the relationship is ambiguous in relation to other fields (eg. referencing User type on more than one field in each type) then you must have a @relation directive, alghough i'm not quite sure if you must assign a name if using the onDelete argument