Monday, November 5, 2012

Dealing with mysql views in schema generation

Hi,

For one of my projects, I need to join up against some static data in another database. The data in this database will never be written to by my application, and the schema does not comply with cake's conventions. I am not able to change the schema to comply with cake's conventions because other non-cake applications depend on and have been written to take advantage of this schema.

As such, I've turned to mysql views - a simple select query massages the format into something cake is comfortable with and this works fine for feeding the static data/lookups on static data into my application.

The problem comes when I try and generate a schema with the schema shell. It generates fine but the schema creates entries for the views as if they were tables, so there is a manual task after the fact to go back in and remove the entries for the views, and then a manual SQL script to create the views.. which is prone to user error (if schemas are run but views are not updated, or views are not removed from schema.php etc).

Does anyone have a nice elegant way of dealing with views in schema generation?

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate