I am currently playing with Spring/JPA/Google App Engine, and there is an issue that I am worrying about.
The cool thing with GAE is, once my mapping is defined, I just need to insert data and everything associated to it is stored too.
However, if I happen to change my mapping, how can I do with my previous data ? Do I have to create migration scripts each time something has changed ? Is there a way to use Liquibase or something like that in this case ? Or is there another way to handle these changes on existing data ?
Thanks a lot for your help!
Rolf
It depends on the nature of those changes, but in most cases, at least some light updating will be required. One big thing to keep in mind is parent-child relationships (see this previous question for more details) and entity groups while design; since parents become part of an entity key, they are very much immutable. Same with key names.
Another thing is that app engine entities are schemaless; for example if you have some class
Fooand you suddenly add a property,prop = db.BooleanProperty(default=True)to it, all existingFooentities will not havepropset to True (though new ones will). Likewise, you will have to manageReferencePropertys andListProperty(db.Key)manually. App Engine does have a_setoperator to help with this, but to be honest I’ve found it to be a bit unreliable, with_sets coming out empty when I knew for a fact that they should not be. Regardless, here’s the documentation on using the_setfunctionality.