Fix database relationship delete rules.