Given sqlalchemy models with server_defaults, alembic may autogenerate
`existing_server_default=sa.text("...")`, which fails typechecking on
the resultant migration because `TextClause` is not currently a valid
annotated type.
Closes: #1577
Pull-request: https://github.com/sqlalchemy/alembic/pull/1577
Pull-request-sha:
e21d07e55847f1e78e53f4f04bc2e458945f83fe
Change-Id: I583748e16f3fccb4d58d8c4aa0e33c00b029523c
*,
nullable: Optional[bool] = None,
comment: Union[str, Literal[False], None] = False,
- server_default: Any = False,
+ server_default: Union[str, bool, Identity, Computed, TextClause] = 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,
existing_server_default: Union[
- str, bool, Identity, Computed, None
+ str, bool, Identity, Computed, TextClause, None
] = False,
existing_nullable: Optional[bool] = None,
existing_comment: Optional[str] = None,
*,
nullable: Optional[bool] = None,
comment: Union[str, Literal[False], None] = False,
- server_default: Any = False,
+ server_default: Union[
+ str, bool, Identity, Computed, TextClause
+ ] = 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,
existing_server_default: Union[
- str, bool, Identity, Computed, None
+ str, bool, Identity, Computed, TextClause, None
] = False,
existing_nullable: Optional[bool] = None,
existing_comment: Optional[str] = None,
*,
nullable: Optional[bool] = None,
comment: Optional[Union[str, Literal[False]]] = False,
- server_default: Any = False,
+ server_default: Union[
+ str, bool, Identity, Computed, TextClause
+ ] = False,
new_column_name: Optional[str] = None,
type_: Optional[Union[TypeEngine[Any], Type[TypeEngine[Any]]]] = None,
existing_type: Optional[
Union[TypeEngine[Any], Type[TypeEngine[Any]]]
] = None,
- existing_server_default: Optional[
- Union[str, bool, Identity, Computed]
+ existing_server_default: Union[
+ str, bool, Identity, Computed, TextClause, None
] = False,
existing_nullable: Optional[bool] = None,
existing_comment: Optional[str] = None,