mssql_include in Index creation is triggering KeyError #513
Labels
Milestone
Comments
Michael Bayer (@zzzeek) wrote: here's a workaround for the moment
|
Michael Bayer (@zzzeek) wrote: |
Changes by Michael Bayer (@zzzeek):
|
Changes by Michael Bayer (@zzzeek):
|
Michael Bayer (@zzzeek) wrote: Add special handling for SQL Server create_index mssql_includes Fixed issue where usage of the SQL Server Change-Id: If58fa35b9db8af473a9654e5a2c8861741810511 → e01041b |
Changes by Michael Bayer (@zzzeek):
|
Florian Vichot (@fvichot) wrote: Awesome, thank you for the quick fix! |
vvvrrooomm
pushed a commit
to vvvrrooomm/alembic
that referenced
this issue
Jan 10, 2019
Fixed issue where usage of the SQL Server ``mssql_include`` option within a :meth:`.Operations.create_index` would raise a KeyError, as the additional column(s) need to be added to the table object used by the construct internally. Change-Id: If58fa35b9db8af473a9654e5a2c8861741810511 Fixes: sqlalchemy#513
vvvrrooomm
pushed a commit
to vvvrrooomm/alembic
that referenced
this issue
Jan 10, 2019
Fixed issue where usage of the SQL Server ``mssql_include`` option within a :meth:`.Operations.create_index` would raise a KeyError, as the additional column(s) need to be added to the table object used by the construct internally. Change-Id: If58fa35b9db8af473a9654e5a2c8861741810511 Fixes: sqlalchemy#513
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Migrated issue, originally created by Florian Vichot (@fvichot)
Hi,
This is on SQL Server 2014, using pyodbc and Microsoft's ODBC driver.
When running a migration containing only the following:
I get the following stack trace:
I've inserted some
print
statements insqlalchemy/dialects/mssql/base.py
just before the crash, and indeed the column 'col_c' is missing from the table model (ie. not in theindex.table.c
list). But if I run the following in mycreate_app()
before theMigrate(app, db)
(from Flask-Migrate which wraps Alembic for Flask):I get the full list of columns:
["col_a", "col_b", "col_c"]
My table is defined as follows:
Versions of components:
And probably not relevant, but just in case:
The text was updated successfully, but these errors were encountered: