I have an entity in my ROOM database.
child_exercises_table
which is populated in PopulateDbAsyncTask
.
@PrimaryKey
int childExercises_id;
private String child_exercise_name;
@Nullable
private String vid_file_path;`
This entity has 3 field: childExercises_id, child_exercise_name and vid_file_path.
Some of the childExercises do not have a vid_file_path
at the moment (null),
however I would like to add some in future updates.
I would also like to rename some of the child_exercise_name
's in future updates.
How can I achieve this while preserving the rest of the data?
Up until now I have been using .fallbackToDestructiveMigration()
and then making updates in populateDbAsyncTask
but I will not be able to use this once the app is published.
(I suspect that this should be done with ROOM migrations, however writing a migration every single time I want to add some vid_file_path
's or maybe change an exercise name doesn't look very efficient and I could see my code getting very confusing after 10+ migrations.)