From: Charly Laurent Date: Tue, 1 Apr 2025 07:38:03 +0000 (+0200) Subject: fix `server_default` type hint X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6642187d254681712443039a95cc1f3110549654;p=thirdparty%2Fsqlalchemy%2Falembic.git fix `server_default` type hint Fixes #1639 --- diff --git a/alembic/op.pyi b/alembic/op.pyi index 13a5852f..14e6c39a 100644 --- a/alembic/op.pyi +++ b/alembic/op.pyi @@ -146,7 +146,9 @@ def alter_column( *, nullable: Optional[bool] = None, comment: Union[str, Literal[False], None] = False, - server_default: Union[str, bool, Identity, Computed, TextClause] = False, + server_default: Union[ + str, bool, Identity, Computed, TextClause, None + ] = False, new_column_name: Optional[str] = None, type_: Union[TypeEngine[Any], Type[TypeEngine[Any]], None] = None, existing_type: Union[TypeEngine[Any], Type[TypeEngine[Any]], None] = None, diff --git a/alembic/operations/base.py b/alembic/operations/base.py index 13993114..d7823a5b 100644 --- a/alembic/operations/base.py +++ b/alembic/operations/base.py @@ -706,7 +706,7 @@ class Operations(AbstractOperations): nullable: Optional[bool] = None, comment: Union[str, Literal[False], None] = False, server_default: Union[ - str, bool, Identity, Computed, TextClause + str, bool, Identity, Computed, TextClause, None ] = False, new_column_name: Optional[str] = None, type_: Union[TypeEngine[Any], Type[TypeEngine[Any]], None] = None, diff --git a/alembic/operations/ops.py b/alembic/operations/ops.py index eebc2323..8c0bdf85 100644 --- a/alembic/operations/ops.py +++ b/alembic/operations/ops.py @@ -1841,7 +1841,7 @@ class AlterColumnOp(AlterTableOp): nullable: Optional[bool] = None, comment: Optional[Union[str, Literal[False]]] = False, server_default: Union[ - str, bool, Identity, Computed, TextClause + str, bool, Identity, Computed, TextClause, None ] = False, new_column_name: Optional[str] = None, type_: Optional[Union[TypeEngine[Any], Type[TypeEngine[Any]]]] = None,