MT#7471 Fix foreign key constraint.