Skip to content

MySQL in some situations will generate spurious remove_constraint #251

@sqlalchemy-bot

Description

@sqlalchemy-bot

Migrated issue, originally created by Johannes Erdfelt (@jerdfelt)

If a table includes a unique index with the same name as a column, the correct_for_autogen_constraints code for MySQL will remove it. This will cause the autogenerate code to generate a spurious remove_constraint.

The attached script reproduces the problem.

I have a patch and unit test that fixes the problem by ignoring unique indexes in correct_for_autogen_constraints since MySQL will never implicitly create a unique index.


Attachments: mysql_testcase.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions