From 25804aeae262fa01256dbd2f045ad4a380644f66 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Thu, 15 Sep 2016 00:50:17 -0400 Subject: Repair foreign_keys population for Join._refresh_for_new_column Fixed bug where setting up a single-table inh subclass of a joined-table subclass which included an extra column would corrupt the foreign keys collection of the mapped table, thereby interfering with the initialization of relationships. Change-Id: I04a0cf98fd456d12d5a5b9e77a46a01246969a63 Fixes: #3797 --- lib/sqlalchemy/sql/selectable.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/sqlalchemy/sql') diff --git a/lib/sqlalchemy/sql/selectable.py b/lib/sqlalchemy/sql/selectable.py index 11ef99f09..43aff7caa 100644 --- a/lib/sqlalchemy/sql/selectable.py +++ b/lib/sqlalchemy/sql/selectable.py @@ -905,7 +905,7 @@ class Join(FromClause): if col is not None: if self._cols_populated: self._columns[col._label] = col - self.foreign_keys.add(col) + self.foreign_keys.update(col.foreign_keys) if col.primary_key: self.primary_key.add(col) return col -- cgit v1.2.1