def save_migration(connection, basename):
    """ Save a migration in `migrations_applied` table """
    sql = 'INSERT INTO migrations_applied (name, date) VALUES (%s, NOW())'
    with connection.cursor() as cursor:
        cursor.execute(sql, (basename,))
        connection.commit()
    return True
