update foreign key consistency