-
Notifications
You must be signed in to change notification settings - Fork 23
How to update the data if the model definition has changed #39
Comments
In his talk (here) @SalomonBrys mentioned that migrations will likely have to be manual. I'm currently prototyping some code for a project using kodein-db and I've been wondering about this question also. My only thought to it is perhaps, instead of updating your model class with new fields, to create a new class with a trailing version: for instance The database would obviously have an empty "table" for the old type, but I can't see that as much of an issue. Iterating a large collection could be costly in terms of performance though. |
Yes I have the thought about that approach too. In my case though, I have just added a new index (the values of the data class itself have not been changed at all) and it took me 1 hour to realize that old entries were not covered by that index. Maybe an |
Migration is the next big subject we need to be working on.
I am currently working on a major shift to the API to allow for type-safe operations & queries, which changes the way models are defined. |
What is the recommended way of updating the data currently stored in the database if the definition of the model has changed (e.g. new fields (may be nullable) or just a new index over existing fields)?
I am asking this because if you for example just add a new index, the old database entries are not covered by this index and therefore not visible for some operations.
The text was updated successfully, but these errors were encountered: