cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tore Halset <>
Subject Re: Update schema
Date Tue, 03 May 2011 06:51:07 GMT

I use the migrate-stuff during startup of my application. However, I have a filter that only
exectutes non-destructive merge-tokens. That is, I only executes CreateTableToDb, AddColumnToDb,
AddRelationshipToDb, SetValueForNullToDb and SetColumnTypeToDb that expand the maxLength.
I have used this in production for a couple of years and it has been very useful.

I should probably include this in a MergeStrategy to fit easier as an alternative to CreateIfNoSchemaStrategy,
but my time for cayenne are unfortunately just to little these days. Perhaps someone else

When changing the schema, there is a need to run some application specific logic for some
of the entities. This task is not handled by the migrate-stuff in cayenne.

 - Tore.

On May 3, 2011, at 02:15 , Steve Springett wrote:

> Currently I'm using CreateIfNoSchemaStrategy and it seems to work quite well
> for the database platforms I'm targeting.
> My question is, is there any way or examples somewhere to update the schema
> if it's different?  For example, if the map contains an additional field,
> table or index I would like Cayenne to be able to create the field, table or
> index to match what is in the map. This would occur on startup for example
> during a product update.
> --Steve

View raw message