]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commitdiff
remove isolate_from_table for dropconstraint
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 13 Jan 2026 17:05:09 +0000 (12:05 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 13 Jan 2026 17:05:09 +0000 (12:05 -0500)
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.

Change-Id: I6af2a683660647980421b1ff761dcf53a61bb71a

alembic/ddl/impl.py
docs/build/changelog.rst
docs/build/unreleased/constraint_dep_revert.rst [new file with mode: 0644]

index 00dd7d86e1b458aac9458b225061b500554a42e7..f75cb77a1c98db9e256d8294eed5136128e8e537 100644 (file)
@@ -412,12 +412,11 @@ class DefaultImpl(metaclass=ImplMeta):
     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(
index bb69fcc843736cdbe9d10c41b41968b320329a51..dea1b461f30472a4e33fdcf98292fd1293b16142 100644 (file)
@@ -60,7 +60,7 @@ Changelog
         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
@@ -68,6 +68,11 @@ Changelog
         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
 
diff --git a/docs/build/unreleased/constraint_dep_revert.rst b/docs/build/unreleased/constraint_dep_revert.rst
new file mode 100644 (file)
index 0000000..c816945
--- /dev/null
@@ -0,0 +1,7 @@
+.. 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.
+