@events.command()
def ensure_consistency():
    """ Delete references to deleted incidents
    """
    from bos_incidents import factory
    storage = factory.get_incident_storage()
    events = storage.get_events(resolve=False)
    for event in events:
        storage.resolve_event(event, only_ensure_consistency=True)
        storage.update_event(event)
