feat: add version migration system for schema changes (Closes #104) #114
Reference in New Issue
Block a user
Delete Branch "feature/issue-104-no-version-migration-system-for-schema-changes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
MigrationRegistryfor chaining sequential migrations, with a concrete v0.1 -> v0.2 migration as the first entrySchemaVersion.CURRENTconstant referenced by all model classesChanges
New files:
model/migration/SchemaVersion.kt— Central version constantmodel/migration/VersionMigration.kt— Migration interfacemodel/migration/MigrationRegistry.kt— Registry that finds and applies migration chainsmodel/migration/MigrationV01ToV02.kt— First concrete migration (adds notes/lifestyles defaults, updates version fields)VersionMigrationTest.kt— 17 unit testsModified files:
DataLoader.kt— Now parses JSON to tree first, applies migrations, then decodesSchemaVersion.CURRENTCloses #104