From df9e3f2fb9804486e2e95bff2f4d2b52fff776c2 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 4 Dec 2011 15:57:08 -0500 Subject: - reflection process always resets the primary key constraint first, fixes extend_existing --- lib/sqlalchemy/schema.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/sqlalchemy/schema.py') diff --git a/lib/sqlalchemy/schema.py b/lib/sqlalchemy/schema.py index b5b057625..496d8e652 100644 --- a/lib/sqlalchemy/schema.py +++ b/lib/sqlalchemy/schema.py @@ -357,6 +357,9 @@ class Table(SchemaItem, expression.TableClause): self._init_items(*args) def _autoload(self, metadata, autoload_with, include_columns): + if self.primary_key.columns: + PrimaryKeyConstraint()._set_parent_with_dispatch(self) + if autoload_with: autoload_with.run_callable( autoload_with.dialect.reflecttable, -- cgit v1.2.1