[Cosmo-dev] bug: 7127 move ContentItem.content and
content* properties to table fields
Randy Letness
randy at osafoundation.org
Thu Oct 19 15:10:16 PDT 2006
Brian Moseley wrote:
>
> what would be *really* nice is to get an auto-upgrade mechanism going
> so that cosmo could detect an out of date schema and upgrade it in
> place. this should be pretty easy to implement and probably should be
> added to 0.6.
Yeah that would be nice. Hibernate has some tools that help updating
the schema, but the hard part is migrating the data. For example, in
the most recent schema change Item.contentLength was moved from the
attribute table to the item table. The schema change is easy as its
just an "alter table.." statement. What is more difficult is going
through all the existing items and removing the "contentLength"
attribute and setting the contentLength field on the item table.
Sometimes this can be done using Hibernate, and others sometimes you
have to use raw JDBC.
Ideally we would have a Migration object for each release that does all
this, and then a 0.5 Cosmo can be upgraded to 0.7 by executing the 0.6
Migration and then the 0.7 Migration.
-Randy
More information about the cosmo-dev
mailing list