New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autogenerate wants to add existing named index #282

Closed
sqlalchemy-bot opened this Issue Mar 10, 2015 · 9 comments

Comments

Projects
None yet
1 participant
@sqlalchemy-bot

sqlalchemy-bot commented Mar 10, 2015

Migrated issue, originally created by dan milon (@danmilon)

I've got the following index

Index(EMAIL_UNIQUE_CONSTRAINT_NAME, func.lower(email), unique=True)

and even though it already exists in the database, a new revision tries to create it again.

op.create_index('user_email_unique', 'user', [sa.text('lower("user".email)')], unique=True)

I think autogenerate is able to catch these kind of indexes. Am I doing something wrong?

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Mar 10, 2015

Michael Bayer (@zzzeek) wrote:

can you please share:

  1. the target database in use (mysql, Postgresql, etc.)

  2. ensure you're on the latest alembic

  3. have you tried the latest master of alembic? there's a MySQL-related fix to unique indexes that is yet unreleased.

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Mar 10, 2015

Changes by Michael Bayer (@zzzeek):

  • added labels: on hold
@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Mar 10, 2015

Michael Bayer (@zzzeek) wrote:

confirmed with postgresql

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Mar 10, 2015

Changes by Michael Bayer (@zzzeek):

  • removed labels: on hold
@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Mar 10, 2015

dan milon (@danmilon) wrote:

Yes, the target database is postgresql :)
Still want me to test with master?

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Mar 10, 2015

Michael Bayer (@zzzeek) wrote:

no I have the issue but this index will need to be excluded entirely for now

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Mar 10, 2015

Changes by dan milon (@danmilon):

  • edited description
@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Mar 10, 2015

Michael Bayer (@zzzeek) wrote:

  • Postgresql "functional" indexes are necessarily skipped from the
    autogenerate process, as the SQLAlchemy backend currently does not
    support reflection of these structures. A warning is emitted
    both from the SQLAlchemy backend as well as from the Alembic
    backend for Postgresql when such an index is detected.
    fixes #282

46761f9

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Mar 10, 2015

Changes by Michael Bayer (@zzzeek):

  • changed status to closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment