diff options
author | Sean Dunn <sean.dunn@ihsmarkit.com> | 2018-06-29 10:26:57 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2018-06-29 10:52:47 -0400 |
commit | ca94ea8ab583f8ab366ee5971bfc1bdd96e54cc9 (patch) | |
tree | a32d239376d13586f8e16db4f123c7a6c6573962 /lib/sqlalchemy/dialects/mssql/information_schema.py | |
parent | b694a309e89e7c3e57e83dd10e9a75c66672c396 (diff) | |
download | sqlalchemy-ca94ea8ab583f8ab366ee5971bfc1bdd96e54cc9.tar.gz |
Add unique_constraint_name to MSSQL FK reflection
Fixed bug in MSSQL reflection where when two same-named tables in different
schemas had same-named primary key constraints, foreign key constraints
referring to one of the tables would have their columns doubled, causing
errors. Pull request courtesy Sean Dunn.
Fixes: #4228
Change-Id: I7dabaaee0944e1030048826ba39fc574b0d63031
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/457
Diffstat (limited to 'lib/sqlalchemy/dialects/mssql/information_schema.py')
-rw-r--r-- | lib/sqlalchemy/dialects/mssql/information_schema.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/sqlalchemy/dialects/mssql/information_schema.py b/lib/sqlalchemy/dialects/mssql/information_schema.py index 103458705..3682fae48 100644 --- a/lib/sqlalchemy/dialects/mssql/information_schema.py +++ b/lib/sqlalchemy/dialects/mssql/information_schema.py @@ -103,6 +103,8 @@ key_constraints = Table("KEY_COLUMN_USAGE", ischema, key="column_name"), Column("CONSTRAINT_NAME", CoerceUnicode, key="constraint_name"), + Column("CONSTRAINT_SCHEMA", CoerceUnicode, + key="constraint_schema"), Column("ORDINAL_POSITION", Integer, key="ordinal_position"), schema="INFORMATION_SCHEMA") |