Re: [sqlalchemy] 'orphan-delete' when one ForeignKey is null on table with multiple ForeignKeys

2017-08-07 Thread Mike Bayer
On Mon, Aug 7, 2017 at 10:45 AM, Ruben Di Battista wrote: > Hello, > I have a tables with two ForeignKeys. When I remove the relation on one > side, SQLAlchemy sets to 'NULL' the related ForeignKey, but the related row > is not considered orphaned since it hase still

[sqlalchemy] 'orphan-delete' when one ForeignKey is null on table with multiple ForeignKeys

2017-08-07 Thread Ruben Di Battista
Hello, I have a tables with two ForeignKeys. When I remove the relation on one side, SQLAlchemy sets to 'NULL' the related ForeignKey, but the related row is not considered orphaned since it hase still the other ForeignKey. Is there a way to make SQLAlchemy fulfill the `orphan-delete' cascade