From 417aeaf1453c67130fb8f1a2bb21c38e6795ce25 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 20 Jan 2014 18:14:02 -0500 Subject: - further refine this so that the ordering of columns is maintained as sent to the primary key constraint; existing tests in the PG dialect confirm this. --- lib/sqlalchemy/engine/reflection.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'lib/sqlalchemy/engine/reflection.py') 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: -- cgit v1.2.1