]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
deprecate inherit_schema argument
authorFederico Caselli <cfederico87@gmail.com>
Mon, 28 Jul 2025 18:14:51 +0000 (20:14 +0200)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 24 Sep 2025 20:33:58 +0000 (16:33 -0400)
commite688617c9256736c739a6899692247ae7fcdcc3b
tree7b479b03b420987b8f55412c49e26a5458d9745b
parentfbb623d9ceac8f5499d0d40f8db6f5606b26b068
deprecate inherit_schema argument

Named types such as :class:`_postgresql.ENUM` and
:class:`_postgresql.DOMAIN` (as well as the dialect-agnostic
:class:`_types.Enum` version) are now more strongly associated with the
:class:`_schema.MetaData` at the top of the table hierarchy and are
de-associated with any particular :class:`_schema.Table` they may be a part
of. This better represents how PostgreSQL named types exist independently
of any particular table, and that they may be used across many tables
simultaneously.  The change impacts the behavior of the "default schema"
for a named type, as well as the CREATE/DROP behavior in relationship to
the :class:`.MetaData` and :class:`.Table` construct.  The change also
includes a new :class:`.CheckFirst` enumeration which allows fine grained
control over "check" queries during DDL operations, as well as that the
:paramref:`_types.SchemaType.inherit_schema` parameter is deprecated and
will emit a deprecation warning when used.  See the migration notes for
full details.

Fixes: #12690
Change-Id: I9752a9d52774ae760ec3448f62fc5046c58d68f5
18 files changed:
doc/build/changelog/migration_21.rst
doc/build/changelog/unreleased_21/10594.rst [deleted file]
doc/build/changelog/unreleased_21/12690.rst [new file with mode: 0644]
doc/build/core/ddl.rst
lib/sqlalchemy/__init__.py
lib/sqlalchemy/dialects/postgresql/named_types.py
lib/sqlalchemy/orm/mapper.py
lib/sqlalchemy/schema.py
lib/sqlalchemy/sql/__init__.py
lib/sqlalchemy/sql/ddl.py
lib/sqlalchemy/sql/schema.py
lib/sqlalchemy/sql/sqltypes.py
test/dialect/postgresql/test_reflection.py
test/dialect/postgresql/test_types.py
test/engine/test_ddlevents.py
test/sql/test_ddlemit.py
test/sql/test_metadata.py
test/sql/test_types.py