Split out of #120, item 4, now that items 1 and 2 (path resolution, and loading/validating bound data) have landed.
Problem
When a schema changes, the data files bound to it by a DataSource silently stop conforming. SchemaDataValidator will now report that they no longer conform (#120), but nothing helps a user fix the data.
Scope
Detect schema changes that affect bound data — a renamed, removed or retyped member, a changed enum value — and generate migration code or scripts that upgrade the data in place.
Dependencies
Notes
Renames are the interesting case and are now tractable: as of #112 a rename cascades through the schema, so a diff sees a member renamed rather than one member removed and another added — but only if the rename is recorded. Consider whether the diff can infer renames, or whether the schema needs to retain rename history for data migration to be reliable.
Acceptance criteria
Split out of #120, item 4, now that items 1 and 2 (path resolution, and loading/validating bound data) have landed.
Problem
When a schema changes, the data files bound to it by a
DataSourcesilently stop conforming.SchemaDataValidatorwill now report that they no longer conform (#120), but nothing helps a user fix the data.Scope
Detect schema changes that affect bound data — a renamed, removed or retyped member, a changed enum value — and generate migration code or scripts that upgrade the data in place.
Dependencies
formatVersionand the migration policy indocs/schema-format.mdestablish how the schema file itself migrates. Data migration should follow the same shape rather than inventing a parallel mechanism.Notes
Renames are the interesting case and are now tractable: as of #112 a rename cascades through the schema, so a diff sees a member renamed rather than one member removed and another added — but only if the rename is recorded. Consider whether the diff can infer renames, or whether the schema needs to retain rename history for data migration to be reliable.
Acceptance criteria