If you Oracle DB, you can use Oracle designer to generate DDL SQL containing only the changes.
-----Original Message----- From: Thomas Dudziak [mailto:[EMAIL PROTECTED] Sent: Friday, June 11, 2004 6:21 AM To: OJB Users List Subject: Re: constantly evolving project On Fri, 11 Jun 2004, David Zejda wrote: > I have a project, where both object and relational model changes with a new > release. Currently I use XDoclet to generate both repository and SQL (via > Torque). Is there any way to generate SQL DDL able to update table > structures to accomodate them to a new object model, preserving data? Or > should I somehow export data from the db to inject them after database > structure update? You can use commons-sql (Jakarta Sandbox). It uses the same XML file as Torque but can also generate ALTER TABLE statements. Btw, I plan to add some support for it to OJB in the near future. A more general way would be a application-space migration strategy which you'll need anyway when the changes are too complex for a simple table schema change. For instance, you could - programmatically - read the data using the old schema, then drop the database and create it anew using the new schema, and finally insert the data. This would allow for more complex scenarios. How you would code that depends on your system, but from OJB to pure SQL all is possible. Tom --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
