diff --git a/alembic/operations/base.py b/alembic/operations/base.py index 649e7f2b..27dd3b9e 100644 --- a/alembic/operations/base.py +++ b/alembic/operations/base.py @@ -1771,7 +1771,7 @@ def create_index( ... def create_primary_key( - self, constraint_name: str, columns: List[str] + self, constraint_name: Optional[str], columns: List[str] ) -> None: """Issue a "create primary key" instruction using the current batch migration context. diff --git a/alembic/operations/ops.py b/alembic/operations/ops.py index 3a9c033c..e6f1fb64 100644 --- a/alembic/operations/ops.py +++ b/alembic/operations/ops.py @@ -349,7 +349,7 @@ def create_primary_key( def batch_create_primary_key( cls, operations: BatchOperations, - constraint_name: str, + constraint_name: Optional[str], columns: List[str], ) -> None: """Issue a "create primary key" instruction using the