Schema migrations between state versions
Provides a registry of ordered, pure migration functions that upgrade state from one schema or app version to the next. Migrations are applied in a chain before validation. Built-in migrations cover library schema changes, and apps register their own, for example for column renames.
Planned. This page shows the specification from issue #201. The live example, source for every framework and the API reference replace it when the feature ships.
Live example
A v1 state is preloaded, using old column ids and a deprecated filter shape, alongside a grid whose definitions are v3.
Expected behavior
Applying the v1 fixture runs the v1 to v2 and v2 to v3 migrations in order. The trace shows each step's diff, and the grid shows renamed columns with their filters preserved. Disabling a migration in the middle of the chain causes a clear 'no migration path' error.
Planned API surface
registerStateMigration({from, to, migrate})migrateState(state)columnRenameMaponStateMigratedAcceptance criteria
- Migrations are pure functions and are executed in ascending version order. (pending)
- A missing step in the chain causes atomic failure with an explanatory error. (pending)
- Dry run returns the migrated state and the trace without applying anything. (pending)
- columnRenameMap provides declarative renames applied across all slices that reference column ids. (pending)
- Migrated state is re-emitted to persistence so that the upgrade happens only once, controlled by the option persistAfterMigration. (pending)