Skip to content

Versioning service

mongorunway.application.services.versioning_service ¤

__all__: typing.Sequence[str] = ('get_previous_migration_version') module-attribute ¤

get_previous_migration_version(migration) ¤

Source code in mongorunway\application\services\versioning_service.py
def get_previous_migration_version(
    migration: typing.Union[domain_migration.Migration, domain_migration.MigrationReadModel], /
) -> typing.Optional[int]:
    return (migration.version - 1) or None