objectbox-java icon indicating copy to clipboard operation
objectbox-java copied to clipboard

Roadmap/Consideration to keep old data after type migration

Open mecoFarid opened this issue 4 years ago • 1 comments

Is there any roadmap or consideration to keep old data while doing type-migration?

Describe the solution you'd like Would be nice to keep old data while doing type-migration. Say @Entity has a long field that should be migrated to int. There could be two solutions:

  1. Automatic migration, if types are not convertible choose the default value provided
  2. Let the developer do data migration

Describe alternatives you've considered Currently, there is no alternative because data migration is internal to ObjectBox and developers don't have the flexibility to handle data migration after type-migration

mecoFarid avatar Mar 30 '21 06:03 mecoFarid

Just keep the "old" property around and add a new one. Then add some logic that checks the old and new properties before returning an actual value to calling code.

Leaving this open for automatic type migration.

greenrobot-team avatar Mar 30 '21 10:03 greenrobot-team