]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
- The behavior of :meth:`.Table.tometadata` has been adjusted such that
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 2 Feb 2014 19:37:43 +0000 (14:37 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 2 Feb 2014 19:37:43 +0000 (14:37 -0500)
commit2d4b457924fa722ef2cf854d8287b9f2f1b51282
tree827d12380d9e2d0c156fa95259e61bd99140014a
parent29de1077b35fb264f4b1727bd1f4987644ff52b7
- The behavior of :meth:`.Table.tometadata` has been adjusted such that
the schema target of a :class:`.ForeignKey` will not be changed unless
that schema matches that of the parent table.  That is, if
a table "schema_a.user" has a foreign key to "schema_b.order.id",
the "schema_b" target will be maintained whether or not the
"schema" argument is passed to :meth:`.Table.tometadata`.  However
if a table "schema_a.user" refers to "schema_a.order.id", the presence
of "schema_a" will be updated on both the parent and referred tables.
This is a behavioral change hence isn't likely to be backported to
0.8; it is assumed that the previous behavior is pretty buggy
however and that it's unlikely anyone was relying upon it.

Additionally, a new parameter has been added
:paramref:`.Table.tometadata.referred_schema_fn`.  This refers to a
callable function which will be used to determine the new referred
schema for any :class:`.ForeignKeyConstraint` encountered in the
tometadata operation.  This callable can be used to revert to the
previous behavior or to customize how referred schemas are treated
on a per-constraint basis.  [ticket:2913]

- rework the tests in test.sql.test_metadata, all the "tometadata" tests
now under new class ToMetaDataTest
doc/build/changelog/changelog_09.rst
lib/sqlalchemy/sql/schema.py
test/sql/test_metadata.py