Skip to main content

Type Alias: MigrationStep

type MigrationStep =
| {
op: "test";
path: string;
type: string;
}
| {
from: string;
op: "rename";
to: string;
}
| {
expr: Expr;
onError?: "null" | "keep" | "fail";
op: "transform";
target: string;
}
| {
op: "default";
target: string;
value: unknown;
when?: Expr;
}
| {
map: Record<string, string>;
op: "remapChoices";
target: string;
unmapped?: "keep" | "drop" | "fail";
}
| {
keep?: "orphan" | "discard";
op: "drop";
target: string;
}
| {
as: string;
into: string;
op: "wrapRepeat";
target: string;
}
| {
as: string;
op: "unwrapRepeat";
pick: "first";
target: string;
}
| {
op: "recalculate";
targets: string[];
};

Defined in: packages/core/src/migrate/types.ts:40

Union Members

Type Literal

{
op: "test";
path: string;
type: string;
}

Refuse the migration unless the value at path has this type.


Type Literal

{
from: string;
op: "rename";
to: string;
}

Type Literal

{
expr: Expr;
onError?: "null" | "keep" | "fail";
op: "transform";
target: string;
}

Type Literal

{
op: "default";
target: string;
value: unknown;
when?: Expr;
}

Type Literal

{
map: Record<string, string>;
op: "remapChoices";
target: string;
unmapped?: "keep" | "drop" | "fail";
}

Type Literal

{
keep?: "orphan" | "discard";
op: "drop";
target: string;
}

Type Literal

{
as: string;
into: string;
op: "wrapRepeat";
target: string;
}

Type Literal

{
as: string;
op: "unwrapRepeat";
pick: "first";
target: string;
}

Type Literal

{
op: "recalculate";
targets: string[];
}