]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Add _extend_on deduplicating set for metadata.reflect()
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 23 Nov 2016 14:14:02 +0000 (09:14 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 23 Nov 2016 15:31:56 +0000 (10:31 -0500)
commit55ad10370f9eb50795e136aac595193168982e92
tree2571e7b7d844dec8cb22cf475188e3ec65cb3184
parent868e98bf407175b016e9e5cbc95bcf0cc859362a
Add _extend_on deduplicating set for metadata.reflect()

The "extend_existing" option of :class:`.Table` reflection would
cause indexes and constraints to be doubled up in the case that the parameter
were used with :meth:`.MetaData.reflect` (as the automap extension does)
due to tables being reflected both within the foreign key path as well
as directly.  A new de-duplicating set is passed through within the
:meth:`.MetaData.reflect` sequence to prevent double reflection in this
way.

Change-Id: Ibf6650c1e76a44ccbe15765fd79df2fa53d6bac7
Fixes: #3861
doc/build/changelog/changelog_11.rst
lib/sqlalchemy/engine/default.py
lib/sqlalchemy/engine/reflection.py
lib/sqlalchemy/sql/schema.py
test/engine/test_reflection.py
test/requirements.py