[LRUG] Multiple databases, migration, integration...

Andrew McDonough andrew at andrewmcdonough.co.uk
Fri Jan 8 04:27:37 PST 2010


2010/1/8 Riccardo Tacconi <rtacconi at gmail.com>:
> This is interesting but I do not think that you can INSERT data in a view in
> MySql. Am I wrong?

I wasn't sure about this either, but it appears you can INSERT, UPDATE
and DELETE  as well as SELECT using a MySQL view (well you can in the
version I'm running here - 5.1.40).  Hence the updates through
ActiveRecord work, without any hacking of the model to account for
naming differences.  You could even handle your migrations in rails
and update the MySQL view at the same time as altering a table,
inverting any changes in self.down.  Has anyone on the list
encountered any problems using this approach?

Regards,

Andrew McDonough



More information about the Chat mailing list