]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Lookup index columns in parent table by key for copy
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 15 Jun 2018 02:56:21 +0000 (22:56 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 15 Jun 2018 02:58:13 +0000 (22:58 -0400)
commitb6f479b5398d0b5e1a710a67195fee8cefbb6092
treeb81feb0cc770d18b534f55f7ab353ab72be806c2
parentbfe993161987a2c3de9321f3e8531901142a654b
Lookup index columns in parent table by key for copy

Fixed regression in 1.2 due to :ticket:`4147` where a :class:`.Table` that
has had some of its indexed columns redefined with new ones, as would occur
when overriding columns during reflection or when using
:paramref:`.Table.extend_existing`, such that the :meth:`.Table.tometadata`
method would fail when attempting to copy those indexes as they still
referred to the replaced column.   The copy logic now accommodates for this
condition.

Change-Id: I521aa2c9f3baa0e84598bbdd6ffe4bf07b6e3ba8
Fixes: #4279
(cherry picked from commit 8f7766cc61479f3c9220c640230eeecd3d49ccc8)
doc/build/changelog/unreleased_12/4279.rst [new file with mode: 0644]
lib/sqlalchemy/sql/schema.py
test/sql/test_metadata.py