You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Alembic, via Flask-Migrate, found this and created the index when I autogenerated the migration. It probably also printed the reflection warning, but I don't recall.
But when I had my next, unrelated migration to autogenerate, it again found that index and added it to the migration, which then fails during the upgrade because the index already exists.
I tried adding that index to alembic:excludes in alembic.ini, but it still created it. If there are any other ways to tell Alembic to ignore that, I'd appreciate knowing. For now I guess I'll just have to manually delete the create/drop index lines from autogenerated migrations going forward.
Versions:
postgresql 9.4.1
alembic==0.8.8
Flask-SQLAlchemy==2.1
SQLAlchemy==1.0.15
The text was updated successfully, but these errors were encountered:
Unwrap unaryexpression when testing for functional index
Fixed bug in Postgresql "functional index skip" behavior where a
functional index that ended in ASC/DESC wouldn't be detected as something
we can't compare in autogenerate, leading to duplicate definitions
in autogenerated files.
Migrated issue, originally created by Dan Craig
Ran across an issue that looks related to #282. I added an index that is a coalesce of other columns, but in descending order, like so:
Alembic, via Flask-Migrate, found this and created the index when I autogenerated the migration. It probably also printed the reflection warning, but I don't recall.
But when I had my next, unrelated migration to autogenerate, it again found that index and added it to the migration, which then fails during the upgrade because the index already exists.
Could this be due to the fact that desc() produces a UnaryExpression, even though it's a functional index, causing it to miss the check at https://bitbucket.org/zzzeek/alembic/commits/46761f9d868c#Lalembic/ddl/postgresql.pyT113 ?
I tried adding that index to alembic:excludes in alembic.ini, but it still created it. If there are any other ways to tell Alembic to ignore that, I'd appreciate knowing. For now I guess I'll just have to manually delete the create/drop index lines from autogenerated migrations going forward.
Versions:
The text was updated successfully, but these errors were encountered: