cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrus Adamchik (Commented) (JIRA)" <>
Subject [jira] [Commented] (CAY-1633) [PATCH] add Migrations API for creating and updating DB schema
Date Mon, 12 Dec 2011 06:54:30 GMT


Andrus Adamchik commented on CAY-1633:

The patch is quite large, so I can't comment on the details  (except that I noticed a few
things like this in the code "import er.extensions.migration.Migration" ;))... The general
observation though:

When the migrations API was proposed and implemented in Cayenne by Tore Halset, we explicitly
discussed its scope and compared with controlled schema migrations solutions (e.g.
). It was decided that Cayenne migrations are something different, based on a different philosophy,
and probably solving a different set of problems. Specifically Cayenne migrations compare
the actual schema and the modeled schema and generate SQL in an attempt to sync the two (both
ways IIRC). Aside from not tracking of the schema versions, they can't for instance migrate
the data (migrating the schema without the data is useless in most real life cases). Hence
the inability of this approach to handle controlled and versioned migrations was a feature,
rather than a lack of feature. 

As of now I am as skeptical as I was about us turning Cayenne into c5-db-like framework, as
it will require us to add functionality that does not really overlap with what Cayenne does,
doesn't use the ORM model, and hence there's no benefit in having it in Cayenne vs. an independent
third-party framework.

Please feel free to take this discussion to the dev list, but for now I am -1 on this patch.
> [PATCH] add Migrations API for creating and updating DB schema
> --------------------------------------------------------------
>                 Key: CAY-1633
>                 URL:
>             Project: Cayenne
>          Issue Type: Improvement
>          Components: Core Library
>    Affects Versions: 3.1M4
>         Environment: Mac 10.6
>            Reporter: John Huss
>            Priority: Minor
>              Labels: patch
>         Attachments: migrations-patch.txt
>   Original Estimate: 24h
>  Remaining Estimate: 24h
> This patch adds classes to create an API for creating and updating DB schema over time
by allowing the user to define Migrations that update the database from one version to the
next.  The API is designed to closely match the SQL syntax used to manipulate tables so it
is very intuitive.  The patch includes unit tests for most functionality, although more could
still be done.  There is also a code generator to generate the initial migration that will
create the database for the first time using the information provided in the DataMaps.  In
the future this would be a great addition to CayenneModeler along with a generator to create
a migration for delta changes to existing schemas.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message