]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- [bug] Fixed bug where reflection of primary key constraint
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 30 Sep 2012 22:24:51 +0000 (18:24 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 30 Sep 2012 22:24:51 +0000 (18:24 -0400)
    would double up columns if the same constraint/table
    existed in multiple schemas.

CHANGES
lib/sqlalchemy/dialects/mssql/base.py

diff --git a/CHANGES b/CHANGES
index 9543c0a5fd528f732ab95417680326d81735136d..09e5d6f50bed52879a4798b82409b643c9029672 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -205,6 +205,10 @@ CHANGES
     attribute, causing the construct to not compile
     correctly a second time.  [ticket:2545]
 
+  - [bug] Fixed bug where reflection of primary key constraint
+    would double up columns if the same constraint/table
+    existed in multiple schemas.
+
 0.7.8
 =====
 - orm
index c544d1d48e93ce17f8dd7572263f043d9947608a..e86715fc29253aa1d20cfe2edb07e487e8562e1c 100644 (file)
@@ -1454,6 +1454,7 @@ class MSDialect(default.DefaultDialect):
         # Primary key constraints
         s = sql.select([C.c.column_name, TC.c.constraint_type],
             sql.and_(TC.c.constraint_name == C.c.constraint_name,
+                     TC.c.table_schema == C.c.table_schema,
                      C.c.table_name == tablename,
                      C.c.table_schema == current_schema)
         )