Update RunSQL type to include parametrized sql (#1015)

* update RunSQL type to include parametrized sql

* fix Black formatting
This commit is contained in:
Jakub Hrabec
2022-06-24 09:08:17 +02:00
committed by GitHub
parent 644052148a
commit c020349f2e

View File

@@ -1,5 +1,5 @@
import sys
from typing import Any, Mapping, Optional, Sequence, Union
from typing import Any, Mapping, Optional, Sequence, Tuple, Union
from django.db.backends.base.schema import BaseDatabaseSchemaEditor
from django.db.migrations.state import StateApps
@@ -21,14 +21,16 @@ class SeparateDatabaseAndState(Operation):
class RunSQL(Operation):
noop: Literal[""] = ...
sql: Union[str, _ListOrTuple[str]] = ...
reverse_sql: Optional[Union[str, _ListOrTuple[str]]] = ...
sql: Union[str, _ListOrTuple[str], _ListOrTuple[Tuple[str, Optional[_ListOrTuple[str]]]]] = ...
reverse_sql: Optional[Union[str, _ListOrTuple[str], _ListOrTuple[Tuple[str, Optional[_ListOrTuple[str]]]]]] = ...
state_operations: Sequence[Operation] = ...
hints: Mapping[str, Any] = ...
def __init__(
self,
sql: Union[str, _ListOrTuple[str]],
reverse_sql: Optional[Union[str, _ListOrTuple[str]]] = ...,
sql: Union[str, _ListOrTuple[str], _ListOrTuple[Tuple[str, Optional[_ListOrTuple[str]]]]],
reverse_sql: Optional[
Union[str, _ListOrTuple[str], _ListOrTuple[Tuple[str, Optional[_ListOrTuple[str]]]]]
] = ...,
state_operations: Sequence[Operation] = ...,
hints: Optional[Mapping[str, Any]] = ...,
elidable: bool = ...,