Finish function of deleting referenced data in join tables when deleting with id.