db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Emminger <e...@ericemminger.com>
Subject Re: Database schema changes: migration how to
Date Thu, 27 Mar 2003 19:10:16 GMT

> This sounds strange to me. I think you can change the business object
> (the non-Peer objects) and add methods to them or fields that need not
> be stored in the database. The moment you have the need for
> fields/properties that you want to store in the database, you should
> change your scheme and recreate the Peer objects (the bussiness objects
> are not touched by regeneration, so changes there remain.

Yes, you can change both the extended business object and even the 
extended Peer. Only the Base* classes are overwritten by Torque when you 
generate the model. So, yes, you could just manually change the Torque 
schema and regenerate the model.

> So I am wondering: if you add those properties to your objects, do you
> also adapt the peer classes?

No, you don't *have* to do anything to the Peer classes, unless you want 
to extend their function.

> Ok, i can imagine that if you add fields according to some kind of
> naming convention and then regenerate this into the xml-schema. But then
> again, is this really a big thing. You have to remember the properties
> you add and add them to the xml scheme.

Sure, this is simple for simple changes. But what if you refactor your 
model, making significant changes, such as breaking out a set of 
properties into a one-to-many relationship? When you deploy the changed 
app, you need to change all the existing data in the database. That 
makes it more complex.


View raw message