summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/engine/reflection.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/engine/reflection.py')
-rw-r--r--lib/sqlalchemy/engine/reflection.py9
1 files changed, 1 insertions, 8 deletions
diff --git a/lib/sqlalchemy/engine/reflection.py b/lib/sqlalchemy/engine/reflection.py
index 9e6cf61dc..45f100518 100644
--- a/lib/sqlalchemy/engine/reflection.py
+++ b/lib/sqlalchemy/engine/reflection.py
@@ -522,16 +522,9 @@ class Inspector(object):
# update pk constraint name
table.primary_key.name = pk_cons.get('name')
- # set the primary key flag on new columns.
- # note any existing PK cols on the table also have their
- # flag still set.
- for col in pk_cols:
- col.primary_key = True
-
# tell the PKConstraint to re-initialize
# it's column collection
- table.primary_key._reload()
-
+ table.primary_key._reload(pk_cols)
fkeys = self.get_foreign_keys(table_name, schema, **table.dialect_kwargs)
for fkey_d in fkeys: