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
mssql_include in Index creation is triggering KeyError #513
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! |
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
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
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: