data model: migration

This commit is contained in:
Kiara Grouwstra 2025-06-23 19:22:47 +02:00
parent 6c2022d064
commit 34529a7de4
Signed by: kiara
SSH key fingerprint: SHA256:COspvLoLJ5WC5rFb9ZDe5urVCkK4LJZOsjfF4duRJFU
2 changed files with 27 additions and 0 deletions

View file

@ -46,6 +46,10 @@ in
module = { };
runtime-environment = config.runtime-environments.bar;
};
migrations.boo = {
deployment = config.deployments.baz;
runtime-environment = config.runtime-environments.bar;
};
}
);
in
@ -54,12 +58,14 @@ in
has-runtime-environment = lib.isAttrs example.runtime-environments.bar.single-ssh-host.module;
has-application = lib.isAttrs example.applications.foo.module;
has-deployment = lib.isAttrs example.deployments.baz.module;
has-migration = lib.isAttrs example.migrations.boo.deployment;
};
expected = {
has-runtime-configuration = true;
has-runtime-environment = true;
has-application = true;
has-deployment = true;
has-migration = true;
};
};
}

View file

@ -127,6 +127,23 @@ let
}
];
};
migration = submoduleWith {
description = "Migration of a Fediversity deployment to a Fediversity run-time environment";
modules = [
{
options = {
deployment = mkOption {
description = "Deployment to migrate";
type = deployment;
};
runtime-environment = mkOption {
description = "Run-time environment to migrate the deployment to";
type = runtime-environment;
};
};
}
];
};
in
{
options = {
@ -146,5 +163,9 @@ in
description = "Deployment of a configuration of applications to a run-time environment";
type = attrsOf deployment;
};
migrations = mkOption {
description = "Migrations from Fediversity deployments to Fediversity run-time environments";
type = attrsOf migration;
};
};
}