]> 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:12:34 +0000 (09:12 -0500)
commite4c4bd03abae2d3948f894d38992d51c9be2a8c0
tree0ae1f5a685f66fd27baad7d3261016631965392f
parentb5e8c80f24c326e8491d1db6c5b32dcf730b53b4
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
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