fixes issues where destroying categories, users, equipment models, or equiment items could cause inconsistencies in the DB