]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
support BLANK_SCHEMA, RETAIN_SCHEMA FK schema on copy
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 26 Mar 2022 14:09:10 +0000 (10:09 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 26 Mar 2022 14:11:47 +0000 (10:11 -0400)
commit1a196d5b7d47ba1d207661e05605bc79badc9a7d
treee5ad9c0080d3a7577f2d1f494100c2ed20fb45b0
parentcdb67369e7c292c6639cf54da487e8482499f5fb
support BLANK_SCHEMA, RETAIN_SCHEMA FK schema on copy

Added support so that the :paramref:`.Table.tometadata.referred_schema_fn`
callable passed to :meth:`.Table.to_metadata` may return the value
:data:`.BLANK_SCHEMA` to indicate that the referenced foreign key should be
reset to None. The :data.`RETAIN_SCHEMA` symbol may also be returned from
this function to indicate "no change", which will behave the same as
``None`` currently does which also indicates no change.

Fixes: #7860
Change-Id: I82a45988d534295d8356453f68001b21d4ff706d
(cherry picked from commit 74d3f3965b383aef7421f2cf1779573a4ac65987)
doc/build/changelog/unreleased_14/7860.rst [new file with mode: 0644]
lib/sqlalchemy/sql/schema.py
test/sql/test_metadata.py