Skip to content

@statesync/persistence


@statesync/persistence / MigrationResult

Interface: MigrationResult<T> ​

Defined in: persistence/src/types.ts:391

The outcome of a data migration attempt.

Contains the migrated data on success, or an Error describing what went wrong on failure. Always includes the version range that was attempted.

Type Parameters ​

Type ParameterDescription
TThe shape of the application state in the target schema version.

Properties ​

data? ​

ts
optional data: T;

Defined in: persistence/src/types.ts:400

The migrated data in the target schema format.

Only present when success is true.


error? ​

ts
optional error: Error;

Defined in: persistence/src/types.ts:413

The error that caused the migration to fail.

Only present when success is false.


fromVersion ​

ts
fromVersion: number;

Defined in: persistence/src/types.ts:403

The schema version of the data before migration was attempted.


success ​

ts
success: boolean;

Defined in: persistence/src/types.ts:393

Whether the migration completed successfully.


toVersion ​

ts
toVersion: number;

Defined in: persistence/src/types.ts:406

The target schema version the migration aimed to reach.

Released under the MIT License.