]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
accommodate False conditions for unique / index merge
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 4 Mar 2024 14:12:34 +0000 (09:12 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 4 Mar 2024 14:13:30 +0000 (09:13 -0500)
commitef9520e432183fd25ea0ba9c9c2a8d8b9d36f8f6
tree365770b239d0f11501e32ad57a53fc376edd8ab7
parenta4e85e728ed92d14157d1a47eea0242b1bf08e01
accommodate False conditions for unique / index merge

Fixed issue in ORM annotated declarative where using
:func:`_orm.mapped_column()` with an :paramref:`_orm.mapped_column.index`
or :paramref:`_orm.mapped_column.unique` setting of False would be
overridden by an incoming ``Annotated`` element that featured that
parameter set to ``True``, even though the immediate
:func:`_orm.mapped_column()` element is more specific and should take
precedence.  The logic to reconcile the booleans has been enhanced to
accommodate a local value of ``False`` as still taking precedence over an
incoming ``True`` value from the annotated element.

Fixes: #11091
Change-Id: I15cda4a0a07a289015c0a09bbe3ca2849956604e
(cherry picked from commit e4c4bd03abae2d3948f894d38992d51c9be2a8c0)
doc/build/changelog/unreleased_20/11091.rst [new file with mode: 0644]
lib/sqlalchemy/sql/schema.py
test/orm/declarative/test_tm_future_annotations_sync.py
test/orm/declarative/test_typed_mapping.py
test/sql/test_metadata.py