weixin_39890652 2020-11-30 11:37
浏览 0

Fix comments about return value in my_compare_type

Migrated issue, originally created by Mauricio Farías ()

The comments are opposite to the code. my_compare_type(context, inspected_column,metadata_column, inspected_type, metadata_type) should return False if the types are different, True if not. It's an issue in the comments not code. I fixed it but I can not push it.

该提问来源于开源项目:sqlalchemy/alembic

  • 写回答

6条回答 默认 最新

  • weixin_39890652 2020-11-30 11:37
    关注

    Michael Bayer () wrote:

    can you provide more specifics as to what you are seeing? the source code uses "True" to mean changed:

    
        isdiff = autogen_context.migration_context._compare_type(
            conn_col, metadata_col)
    
        if isdiff:
            alter_column_op.modify_type = metadata_type
            log.info("Detected type change from %r to %r on '%s.%s'",
                     conn_type, metadata_type, tname, cname
                     )
    
    
    评论

报告相同问题?