[1.7.x] Fixed #22460 -- Explicity remove constraints when dropping a related field.

Backport of 0e45669fa9 from master