]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Skip UniqueConstraint marked by unique=True in tometadata
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 2 Jun 2016 17:52:27 +0000 (13:52 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 2 Jun 2016 17:54:38 +0000 (13:54 -0400)
commitd318139fdc4c0c381fc5618d73b9b33e0d73a4f5
tree66197cb6d7630b58e28ca7cbe9895092821b1b29
parent47f9b9f07ee54723813e956a76f46eb4fbe05519
Skip UniqueConstraint marked by unique=True in tometadata

Fixes an issue where a Column would be copied with unique=True
and at the same time the UniqueConstraint would also be copied,
leading to duplicate UniqueConstraints in the target table,
when tometadata() is used.   Imitates the same logic used
by index=True/Index to avoid duplicates.  For some reason
a fix was implemented for Index long ago but never for
UniqueConstraint.

Change-Id: Ie622ee912a6fb8bf0ea900a8b09d78c7ebc79fc0
Fixes: #3721
(cherry picked from commit afb466fb8bd9c2f8709e79fd0fce422b83ff1d6b)
doc/build/changelog/changelog_10.rst
lib/sqlalchemy/sql/schema.py
test/sql/test_metadata.py