fix branch delete when contains clients, fk constraints issue