Deleting resources that have existing relationships
Version info:
So I have a Ash Postgres resource, lets call it
I also have another Ash Postgres resource called
Whenever a change happens to
However if a resource instance of
In my
To my understanding this should make it possible to destroy a
However, when I try to delete a
I've found the source of the error in
https://github.com/ash-project/ash_postgres/blob/0ad06c6b636c4b4d3ff66971ddde68828d446667/lib/data_layer.ex#L1484-L1485
What do I need to do to allow the destruction of resources instances that have references to others?
So I have a Ash Postgres resource, lets call it
Car.I also have another Ash Postgres resource called
CarLog.Whenever a change happens to
Car a CarLog with the nature of the change is created. (so 1:many relation between Car:CarLog)However if a resource instance of
Car is deleted I don't want to delete and of the CarLogs associated with it.In my
CarLog resource I have:To my understanding this should make it possible to destroy a
Car resource instance, and leave the associated CarLogs behind?However, when I try to delete a
Car with existing CarLogs I'm getting this error:I've found the source of the error in
ash_postgres, and seems to because it doesn't meet a foreign key constraint:https://github.com/ash-project/ash_postgres/blob/0ad06c6b636c4b4d3ff66971ddde68828d446667/lib/data_layer.ex#L1484-L1485
What do I need to do to allow the destruction of resources instances that have references to others?
