Fixed sqlite bug in delete_all_models