No need to go overboard on modularization here; a single _check_on_delete() encompassing both the SET_NULL and SET_DEFAULT check would be sufficient.