From 513ab5d8029eaeb8cccee8eb931774d13a08d726 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Tue, 16 May 2023 08:55:51 -0400 Subject: restore drop_index.table_name, drop_constraint.type_ as positional These two API changes were identified as having legacy use patterns and should be revisited using a deprecation warning for removal in either 1.12 or 1.13. Add documentation re: Alembic not using semver, fix incorrect calling signature example in batch documentation. Change-Id: I33dc5a8d058bcce77591bb037ae964e626a3387f Fixes: #1243 Fixes: #1245 --- alembic/op.pyi | 4 ++-- alembic/operations/base.py | 6 +++--- alembic/operations/ops.py | 9 ++++----- 3 files changed, 9 insertions(+), 10 deletions(-) (limited to 'alembic') diff --git a/alembic/op.pyi b/alembic/op.pyi index 10e6f59..931f1bb 100644 --- a/alembic/op.pyi +++ b/alembic/op.pyi @@ -933,8 +933,8 @@ def drop_column( def drop_constraint( constraint_name: str, table_name: str, - *, type_: Optional[str] = None, + *, schema: Optional[str] = None, ) -> None: r"""Drop a constraint of the given name, typically via DROP CONSTRAINT. @@ -952,8 +952,8 @@ def drop_constraint( def drop_index( index_name: str, - *, table_name: Optional[str] = None, + *, schema: Optional[str] = None, **kw: Any, ) -> None: diff --git a/alembic/operations/base.py b/alembic/operations/base.py index 4e59e5b..853e795 100644 --- a/alembic/operations/base.py +++ b/alembic/operations/base.py @@ -1335,8 +1335,8 @@ class Operations(AbstractOperations): self, constraint_name: str, table_name: str, - *, type_: Optional[str] = None, + *, schema: Optional[str] = None, ) -> None: r"""Drop a constraint of the given name, typically via DROP CONSTRAINT. @@ -1356,8 +1356,8 @@ class Operations(AbstractOperations): def drop_index( self, index_name: str, - *, table_name: Optional[str] = None, + *, schema: Optional[str] = None, **kw: Any, ) -> None: @@ -1787,7 +1787,7 @@ class BatchOperations(AbstractOperations): ... def drop_constraint( - self, constraint_name: str, *, type_: Optional[str] = None + self, constraint_name: str, type_: Optional[str] = None ) -> None: """Issue a "drop constraint" instruction using the current batch migration context. diff --git a/alembic/operations/ops.py b/alembic/operations/ops.py index 5334a01..3c37fee 100644 --- a/alembic/operations/ops.py +++ b/alembic/operations/ops.py @@ -132,8 +132,8 @@ class DropConstraintOp(MigrateOperation): self, constraint_name: Optional[sqla_compat._ConstraintNameDefined], table_name: str, - *, type_: Optional[str] = None, + *, schema: Optional[str] = None, _reverse: Optional[AddConstraintOp] = None, ) -> None: @@ -196,8 +196,8 @@ class DropConstraintOp(MigrateOperation): operations: Operations, constraint_name: str, table_name: str, - *, type_: Optional[str] = None, + *, schema: Optional[str] = None, ) -> None: r"""Drop a constraint of the given name, typically via DROP CONSTRAINT. @@ -221,7 +221,6 @@ class DropConstraintOp(MigrateOperation): cls, operations: BatchOperations, constraint_name: str, - *, type_: Optional[str] = None, ) -> None: """Issue a "drop constraint" instruction using the @@ -1016,8 +1015,8 @@ class DropIndexOp(MigrateOperation): def __init__( self, index_name: Union[quoted_name, str, conv], - *, table_name: Optional[str] = None, + *, schema: Optional[str] = None, _reverse: Optional[CreateIndexOp] = None, **kw: Any, @@ -1065,8 +1064,8 @@ class DropIndexOp(MigrateOperation): cls, operations: Operations, index_name: str, - *, table_name: Optional[str] = None, + *, schema: Optional[str] = None, **kw: Any, ) -> None: -- cgit v1.2.1