def add_constraint(self, const: Any, **kw: Any) -> None:
if const._create_rule is None or const._create_rule(self):
if sqla_compat.sqla_2_1:
+ # this should be the default already
kw.setdefault("isolate_from_table", True)
self._exec(schema.AddConstraint(const, **kw))
def drop_constraint(self, const: Constraint, **kw: Any) -> None:
- if sqla_compat.sqla_2_1:
- kw.setdefault("isolate_from_table", True)
self._exec(schema.DropConstraint(const, **kw))
def rename_table(
commands.
.. change::
- :tags: usecase
+ :tags: usecase, operations
Avoid deprecation warning in add/drop constraint added in SQLAlchemy 2.1.
Ensure that alembic is compatible with the changes added in
by explicitly setting ``isolate_from_table=True`` when running with
SQLAlchemy 2.1 or greater.
+ .. note::
+
+ This change was revised in Alembic 1.18.1; futher developments
+ in SQLAlchemy 2.1 necessitated further adjustments.
+
.. change::
:tags: feature, autogenerate
--- /dev/null
+.. change::
+ :tags: bug, operations
+
+ Revised the change regarding SQLAlchemy 2.1 and deprecation warnings
+ related to ``isolate_from_table=True``. Further developments in release 2.1
+ have revised how this parameter will be modified.
+