def METHOD_NAME(self, db):
    # Delete orphaned entries in the console table
    # which are older than one day
    r = db.execute_one_dict('''
        SELECT count(*) count
        FROM console
        WHERE date < NOW() - INTERVAL '1 day'
    ''')
    logger.info('Deleting %s orphaned console entries', r['count'])
    r = db.execute('''
        DELETE
        FROM console
        WHERE date < NOW() - INTERVAL '1 day'
    ''')
    db.commit()