diff --git a/alembic/operations/base.py b/alembic/operations/base.py index bd1b170d..649e7f2b 100644 --- a/alembic/operations/base.py +++ b/alembic/operations/base.py @@ -1721,7 +1721,7 @@ def create_exclude_constraint( def create_foreign_key( self, - constraint_name: str, + constraint_name: Optional[str], referent_table: str, local_cols: List[str], remote_cols: List[str], diff --git a/alembic/operations/ops.py b/alembic/operations/ops.py index 0282d571..3a9c033c 100644 --- a/alembic/operations/ops.py +++ b/alembic/operations/ops.py @@ -681,7 +681,7 @@ def create_foreign_key( def batch_create_foreign_key( cls, operations: BatchOperations, - constraint_name: str, + constraint_name: Optional[str], referent_table: str, local_cols: List[str], remote_cols: List[str],