objectbox / objectbox/objectbox-java
"Nuke version" to simplify data model changes during development
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 4.6k
- Forks
- 311
- PR merge metrics
- No merged PRs in 30d
Description
For renames and type changes, there is an UID-based approach to work with already deployed databases.
However during development, it may just be easier to wipe all data and model data.
API outline:
MyObjectBox.builder().version(7).nukeDataBeforeVersion(7)
Thus, ObjectBox would track the current version of the data model, and just discard everything for earlier versions.
Alternative API: annotations, but where to apply them? Also the builder seems appropriate because that's where the initialization happens.
Looking into the future, this approach should also work nicely with custom migration callbacks. E.g.
MyObjectBox.builder().version(10).nukeDataBeforeVersion(7).migrate(new MyMigration())
Here, versions 1 to 6 just would be nuked, and version 10 would be applied. For versions 7 to 9, the custom migration would be triggered.
Feedback on this approach welcome!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No file or test is named; start by reviewing the MyObjectBox.builder() initialization path and how data-model versions are tracked. Define the API and behavior for discarding data from earlier versions while preserving the proposed custom migration handling for later versions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- database
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100