(engine, diffs)
return index_diffs
Note that this does not actually create the indexes. Indexes must be created
    manually by copying the log output.
Note that this does not actually create the indexes. Indexes must be created
    manually by copying the log output.
Note that this does not actually create the indexes . Indexes must be created manually by copying the log output .
def apply_index_changes(engine, diffs):
    """Note that this does not actually create the indexes. Indexes must be created
    manually by copying the log output.
    """
    index_diffs = _get_indexes_diffs_to_change(diffs)
    remove_indexes = [index.index for index in index_diffs if index.type == DiffTypes.REMOVE_INDEX]
    add_indexes = [index.index for index in index_diffs if index.type == DiffTypes.ADD_INDEX]

    for index in add_indexes:
        column_names = ', '.join(c.name for c in index.columns)
        logger.info(f'CREATE INDEX CONCURRENTLY "{index.name}" ON "{index.table.name}" ({column_names})')

    # don't remove indexes automatically because we want to be able to add them
    # concurrently without the code removing them
    for index in remove_indexes:
        logger.info(f'DROP INDEX CONCURRENTLY "{index.name}"')

    return index_diffs
def apply_index_changes ( engine , diffs ) : index_diffs = _get_indexes_diffs_to_change ( diffs ) remove_indexes = [ index . index for index in index_diffs if index . type == DiffTypes . REMOVE_INDEX ] add_indexes = [ index . index for index in index_diffs if index . type == DiffTypes . ADD_INDEX ] for index in add_indexes : column_names = ', ' . join ( c . name for c in index . columns ) logger . info ( f'CREATE INDEX CONCURRENTLY "{index.name}" ON "{index.table.name}" ({column_names})' ) # don't remove indexes automatically because we want to be able to add them # concurrently without the code removing them for index in remove_indexes : logger . info ( f'DROP INDEX CONCURRENTLY "{index.name}"' ) return index_diffs