Nacho, this may be a silly question, have you used the datastore api or app-engine?
On Fri, Mar 12, 2010 at 2:19 PM, Nacho Coloma <[email protected]> wrote: >> Because the datastore has no schema the interfaces need to define the schema >> themselves - as Java objects and some annotations. So if you are already >> defining the schema at the data model level it makes sense to define changes >> there too. >> >> Do you mean use the low-level api instead to alter the data? In that case >> you still need to configure the interface to read/write the new format - so >> may as well reuse it, no? > > This is the point were we differ. To me it makes all sense to prepare > a low-level API for schema migration, but I would not bind it to the > current mappings. I mean, the possibilities here are just too many, > and the up-to-date persistence mappings are not relevant to do the > migration. They seem to be more of a hassle than helpful for that > purpose. Okay, I'll bit. How do you do schema migration (both on a live system, and in a batch way), in the low-level api?. In the datastore every entity has its own schema. There is no way to alter the schema without altering the data that is stored in an entity. > I may be wrong, so I am just asking. I was comparing the examples > given here with what would be the equivalent of porting to GAE the > typical schema upgrade script, and didn't see much benefit in it. What "update script" are you talking about? The only way to update data in the datastore is write it back to the datastore; There is no DDL, or metadata language, or data transformation system for the datastore, that I know about. >> I do remember something in HIbernate that could generate "update table" >> scripts from changed config files. But I guess with all back ends they had >> to support it was a much tougher job. > > AFAIK they have something to create the DDL, but then you should use > your own database tools to create the upgrade script. They can create schema, and migrate schema automatically (generating the alter scripts without dropping the tables), assuming the types of changes you do are supported. I've found hibernate to do a good job in creating and migrating schema automatically for development, and if careful, production too. It is considered good practice to generate the migration scripts from hibernate, and then hand-fix them to be safe. -- You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
