cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tad <tadfis...@gmail.com>
Subject Modeling MySQL views and primary keys
Date Sat, 04 Feb 2012 00:11:29 GMT
We've got an existing MySQL 5.x database that contains a single view. This
view includes the primary key column of its source table in its results.

When modeling this view with a db-entity (through re-engineering,
migration, and manual creation) the modeler tells us that the entity lacks
a primary key column (even though the modeler picks up the column and adds
it as an attribute). So, we assign the appropriate PK column, and this
error disappears.

The problem now is that any future migrations attempt to alter the view and
add a primary key (using ALTER TABLE, no less), and we have to know not to
apply these changes to the database schema.

Is there a way to suppress this behavior? Perhaps by ignoring the view
entirely, or adding something to the view definition itself to assign the
"primary key" attribute to a column of its results?

Thanks for any help.

-Tad Fisher

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message