Fixed issue where the :class:`.ExcludeConstraint` construct did not
correctly forward the :paramref:`.ExcludeConstraint.info` parameter to
the superclass, causing user-defined metadata to be lost. Pull request
courtesy Wiktor Byrka.
Fixes: #13317
Closes: #13316
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/13316
Pull-request-sha:
be7f4fee2c40d1986519e93145471faad61021af
Change-Id: Idc4846f02127d1d39a8c638cb03b0379932e9fd6
--- /dev/null
+.. change::
+ :tags: bug, postgresql
+ :tickets: 13317
+
+ Fixed issue where the :class:`.ExcludeConstraint` construct did not
+ correctly forward the :paramref:`.ExcludeConstraint.info` parameter to
+ the superclass, causing user-defined metadata to be lost. Pull request
+ courtesy Wiktor Byrka.
+
Optional string. If set, emit INITIALLY <value> when issuing DDL
for this constraint.
+ :param info: Optional data dictionary which will be populated into the
+ :attr:`.SchemaItem.info` attribute of this object.
+
+ .. versionadded:: 2.0.50
+
:param using:
Optional string. If set, emit USING <index_method> when issuing DDL
for this constraint. Defaults to 'gist'.
name=kw.get("name"),
deferrable=kw.get("deferrable"),
initially=kw.get("initially"),
+ info=kw.get("info"),
)
self.using = kw.get("using", "gist")
where = kw.get("where")
")",
)
+ def test_exclude_constraint_info(self):
+ ec = ExcludeConstraint(("a", "="))
+ eq_(ec.info, {})
+
+ ec = ExcludeConstraint(("a", "="), info={"foo": "bar"})
+ eq_(ec.info, {"foo": "bar"})
+
def test_exclude_constraint_min(self):
m = MetaData()
tbl = Table("testtbl", m, Column("room", Integer, primary_key=True))