Skip to content

Migration command

mongorunway.domain.migration_command ¤

AnyCommand: typing.TypeAlias = 'MigrationCommand[typing.Any]' module-attribute ¤

AnyCommandSequence: typing.TypeAlias = typing.Sequence[AnyCommand] module-attribute ¤

__all__: typing.Sequence[str] = ('MigrationCommand', 'AnyCommandSequence', 'AnyCommand') module-attribute ¤

MigrationCommand ¤

Bases: typing.Generic[_CallbackT_co], abc.ABC

Source code in mongorunway\domain\migration_command.py
class MigrationCommand(typing.Generic[_CallbackT_co], abc.ABC):
    __slots__ = ()

    @property
    def name(self) -> str:
        return self.__class__.__name__

    @abc.abstractmethod
    def execute(self, ctx: domain_context.MigrationContext) -> _CallbackT_co:
        ...

__slots__ = () instance-attribute class-attribute ¤

name: str property ¤

execute(ctx) abstractmethod ¤

Source code in mongorunway\domain\migration_command.py
@abc.abstractmethod
def execute(self, ctx: domain_context.MigrationContext) -> _CallbackT_co:
    ...