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

Autogenerate generates spurious indexes (and drops them immediately)

Migrated issue, originally created by MartinH ()

Not sure since how long this happens, but it seems my colleagues have seen this for some time.

What happens: When autogenerating a migration, it is full of

python
    op.create_index('answer.fk_answer_question', 'answer', ['questionid'], unique=False)
    op.drop_index('answer.fk_answer_question', table_name='answer')

pairs. It seems one for every id in our data model.

I assume it's a bug, as the generated create/drop pair doesn't seem to do anything.

(It generates them all in the upgrade, and then again in the downgrade method...)

What kind of additional info can I provide?

version: Python 2.7.10, alembic (0.9.6), SQLAlchemy (0.9.10)

Now that I write this, the old version of SQLAlchemy is quite likely a problem - if you agree, I'm going to work on updating that dependency next.

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

  • 写回答

15条回答 默认 最新

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

    MartinH () wrote:

    python 2.7 of course... ahem

    评论

报告相同问题?