Skip to content

Autogenerate detected removed index, for constraints #157

Closed
@sqlalchemy-bot

Description

@sqlalchemy-bot

Migrated issue, originally created by John Kida (@jkida)

(Postgresql)
It appears everywhere I have a constraint in my sqlalchemy code in which there is a unique constaint index alembic --autogenerate wants to remove it.

ie.
python code:
lead_id = Column(Integer, ForeignKey('crm_lead.id'), unique=True)

DataBase \d:
Indexes:
"chat_pkey" PRIMARY KEY, btree (id)
"chat_lead_id_key" UNIQUE CONSTRAINT, btree (lead_id)

INFO [alembic.autogenerate.compare] Detected removed index 'chat_lead_id_key' on 'chat'

It appears alembic does not consider constraints as indexes, and psql does.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions