@@ -63,12 +63,7 @@ def get_timestamp_string() -> str:
6363
6464if TYPE_CHECKING :
6565 from infrahub .cli .context import CliContext
66- from infrahub .core .migrations .shared import (
67- ArbitraryMigration ,
68- GraphMigration ,
69- InternalSchemaMigration ,
70- MigrationRequiringRebase ,
71- )
66+ from infrahub .core .migrations .shared import MigrationTypes
7267 from infrahub .database import InfrahubDatabase
7368 from infrahub .database .index import IndexManagerBase
7469
@@ -287,10 +282,10 @@ async def index(
287282
288283async def detect_migration_to_run (
289284 current_graph_version : int , migration_number : int | str | None = None
290- ) -> Sequence [GraphMigration | InternalSchemaMigration | ArbitraryMigration | MigrationRequiringRebase ]:
285+ ) -> Sequence [MigrationTypes ]:
291286 """Return a sequence of migrations to apply to upgrade the database."""
292287 rprint ("Checking current state of the database" )
293- migrations : list [GraphMigration | InternalSchemaMigration | ArbitraryMigration | MigrationRequiringRebase ] = []
288+ migrations : list [MigrationTypes ] = []
294289
295290 if migration_number :
296291 migration = get_migration_by_number (migration_number )
@@ -316,9 +311,7 @@ async def detect_migration_to_run(
316311
317312
318313async def migrate_database (
319- db : InfrahubDatabase ,
320- migrations : Sequence [GraphMigration | InternalSchemaMigration | ArbitraryMigration | MigrationRequiringRebase ],
321- initialize : bool = False ,
314+ db : InfrahubDatabase , migrations : Sequence [MigrationTypes ], initialize : bool = False
322315) -> bool :
323316 """Apply the latest migrations to the database, this function will print the status directly in the console.
324317
0 commit comments