We have started to notice an SAWarning from sqlalchemy indicating:
SAWarning: Cannot correctly sort tables; there are unresolvable
cycles between tables "allocations, nodes", which is usually
caused by mutually dependent foreign key constraints.
Foreign key constraints involving these tables will not be
considered; this warning may raise an error in a future release.
Hunting this down, it appears to be the two data consistency Foreign
Key constraints in the "allocations" table where an allocation would
try to have a conductor_affinity value mapped to conductors.id
and also have a direct association to a node, which *also* had the
same constraint.
And then similarlly, mapping in reverse, asserting a fk constraint,
when nodes also had it's own constraint back on allocations.
Sort of a circular loop.
Anyhow, removes it, and adds a db migration to remove the two
constraints.
Change-Id: I5596008e4971a29c635c45b24cb85db2d0d13ed3