def delete_migration(connection, basename):
    """ Delete a migration in `migrations_applied` table """

    # Prepare query
    sql = "DELETE FROM migrations_applied WHERE name = %s"

    # Run
    with connection.cursor() as cursor:
        cursor.execute(sql, (basename,))
        connection.commit()

    return True
Delete a migration in `migrations_applied` table