Required
project_path| Type: | pathlib.Path |
| Description: | The path to the Salvus project. |
def migrate_salvus_project(
project_path: pathlib.Path, from_revision: str | None, to_revision: str
) -> None: ...| Type: | pathlib.Path |
| Description: | The path to the Salvus project. |
| Type: | str | None |
| Description: | The revision to start at. |
| Type: | str |
| Description: | The revision to end at. |
class Migration(builtins.object):
def __init__(
self,
revision: str,
title: str,
down_revision: str | None,
applies_after_salvus_version: str,
upgrade_function: typing.Callable[[pathlib.Path], None],
downgrade_function: typing.Callable[[pathlib.Path], None] | None,
) -> None: ...| Type: | str |
| Description: | The revision hash. |
| Type: | str |
| Description: | The title of the migration. |
| Type: | str | None |
| Description: | The hash of the previous revision. Only the initial migration is allowed to not have this set. |
| Type: | str |
| Description: | The Salvus version users would need to use to not apply this migration. E.g. the next Salvus version will make a change that mandates this migration. |
| Type: | typing.Callable[[pathlib.Path], None] |
| Description: | The upgrading function to go from the previous to this revision. |
| Type: | typing.Callable[[pathlib.Path], None] | None |
| Description: | An optional downgrade function that is currently not used for anything but could be added. |
def parse_file(filename: pathlib.Path) -> Migration: ...| Type: | pathlib.Path |
| Description: | The file containing the migration. |
class Migrations(builtins.object):
def __init__(
self, order: list[str], migrations: list[Migration]
) -> None: ...| Type: | list[str] |
| Description: | The order of the migrations. |
| Type: | list[Migration] |
| Description: | The actual migrations. |
class SalvusProjectVersion(builtins.object):
def __init__(
self, project_path: pathlib.Path, apply_migrations: bool | None = None
): ...| Type: | pathlib.Path |
| Description: | Path to the Salvus project. |
| Type: | bool | None |
| Default value: | None |
| Description: | If True, automatically apply necessary migrations, if False, raise if migrations are needed. If None, ask the user with an interactive prompt. |
str | None)-Get the current version number of the project file structure.