This is the default behavior -- any new fields you add will have values of null for entities stored before the new fields were added. - Jason
On Mon, Sep 21, 2009 at 11:11 AM, Riyad <[email protected]> wrote: > > David & bgood, > > My apologies for not replying sooner. I had an "Archive It" rule setup > for GAE digest emails that consumed the reply notifications as well. > > I really appreciate the info David, that is actually what I was > *hoping* the behavior would be. For this to work do you just keep the > "ddl.generation" argument set to true at all times in your persistence > file or JDO does this by default? > > Best, > Riyad > > On Sep 15, 8:12 am, David Fuelling <[email protected]> wrote: > > The way I understand it is if you add a new field to your entity, you > > don't have to do anything to the datastore. You can just deploy, and > > everything will work. The datastore entries that you entered *before* > > will just have empty values in the new attribute columns. > > > > For example, you start with an entity with a single attribute of > > "FirstName", and store one (name="David") into the datastore. Later, > > you add a new attribute ("LastName") and add another entry to the > > datastore ("John", "Smith"). The older entry (Firstname="David") will > > just have an empty lastname. > > > > You may want to do some "data cleanup" (e.g., add last names to > > everyone without) or handle the "empty last name" case in your code so > > nothing breaks. > > > > On Sep 15, 1:18 pm, Riyad <[email protected]> wrote: > > > > > No one has any idea how to grow a JDO-based datamodelover time? :( > > > > > On Sep 14, 7:46 pm, Riyad <[email protected]> wrote: > > > > > > Something I'm trying to understand, when living and working in the > > > > Google App Engine world, is how one most effectively manages and > grows > > > > their datamodelover time as your application grows and changes. > > > > > > For a simple example, let's saw you write a commercial dating site > > > > that you deploy on App Engine. In the 1.0 release, your JDOmodelis > > > > straight forward and works without a much of a hickup. > > > > > > Now let's say you are working on the 2.0 release, and have added a > lot > > > > of new fields for new users (Twitter account, Facebook page, etc. > > > > etc.). > > > > > > In the SQL/JPA/Hibernate world, to manage this cleanly I've done the > > > > following when rolling out a new version of an app that has changes > to > > > > the datamodel: > > > > > > 1. Create a .SQL file that contains the "ALTER TABLE" scripts > > > > necessary to move my SQL database from version 1 to version 2. > > > > > > 2. Store this .SQL file in the project in source control as part of > an > > > > official upgrade pack if necessary. > > > > > > 3. After running the SQL script to modify the underlying SQL-based > > > > database, deploy the APP. On restart the updated JPA entities see the > > > > fields they are mapped to and behave correctly. > > > > > > In the case of a Google App Engine app where everything is JDO, how > > > > are missing fields handled? I know there is the auto-create property > > > > to do the CREATE TABLE statements when the underlying structure is > > > > missing with a SQL-based database, but I really don't understand how > > > > to "adjust" the underlying BigTable-based data structure for version > 2 > > > > of my app such that when I roll it out, my app upgrades correctly and > > > > behaves itself. > > > > > > How do you guys handle this? > > > > > > Best, > > > > Riyad > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
