> 1. You are right - current Cayenne schema generation is all or nothing.
> You can drop and recreate your tables but there is no "merge".
>
> 2. In the future we will definitely improve that. This is in the plans.
> However there is a huge BUT, which lead us to (3)...
>
> 3. In a general case "merging" DB schema with the evolved model is not
> just add/drop column. Most real life migrations between schema versions
> are incomparably more complex than that. They involve moving data
> within and between tables, modifying this data in the process,
> intermingling DDL and DML statements, and is generally impossible to
> automate.
this much ist true
> In my work as a consultant, I've spent a fair amount of time on various
> projects trying to automate or at least improve tedious database schema
> upgrade process between the code versions. My conclusion is that full
> generic (and most importantly - working) automation is impossible. If
> you have a production DB with lots of data, expect doing manual SQL
> coding. Somebody please prove me wrong on that!
I've been resposible for this in several projects, and we solved most
of the problems with simple rules:
- only add missing Attributes and Tables
- do an automatic data conversion/transfer in the
baseclasses of the software. We mostly used
some special database entries to find out if there
is any action to happen. So as example was an
order with a special orderid added, when a kind
of conversion was done ...
> On a more optimistic note, we can still *greatly* improve this
> experience by providing a dumb generated "SQL patch" that compares
> current DB state and current Cayenne DataMap, and generates "create
> table/add column/drop column" statements without regards to the actual
> data migration path... It can be saved and later manually customized
> for the actual DB run. That's where we are heading.
NO automatic drops, please.
____________________________________________________
Aufnehmen, abschicken, nah sein - So einfach ist
WEB.DE Video-Mail: http://freemail.web.de/?mc=021200
This archive was generated by hypermail 2.0.0 : Tue Jul 27 2004 - 05:54:57 EDT