Skip to content

Commit 5b300e1

Browse files
committed
Typing for MigrationLoader and MigrationRecorder (not ideal)
1 parent 9b43617 commit 5b300e1

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

plain-models/plain/models/migrations/executor.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
from contextlib import nullcontext
55
from typing import TYPE_CHECKING, Any
66

7+
from plain.models.connections import DatabaseConnection
8+
79
from ..transaction import atomic
810
from .loader import MigrationLoader
911
from .migration import Migration
@@ -22,7 +24,7 @@ class MigrationExecutor:
2224

2325
def __init__(
2426
self,
25-
connection: BaseDatabaseWrapper,
27+
connection: BaseDatabaseWrapper | DatabaseConnection,
2628
progress_callback: Callable[..., Any] | None = None,
2729
) -> None:
2830
self.connection = connection

plain-models/plain/models/migrations/loader.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,9 @@ def build_graph(self) -> None:
317317
raise
318318
self.graph.ensure_not_cyclic()
319319

320-
def check_consistent_history(self, connection: BaseDatabaseWrapper) -> None:
320+
def check_consistent_history(
321+
self, connection: BaseDatabaseWrapper | DatabaseConnection
322+
) -> None:
321323
"""
322324
Raise InconsistentMigrationHistory if any applied migrations have
323325
unapplied dependencies.

0 commit comments

Comments
 (0)