[LRUG] Initial migration for new Rails 4 project using existing postgres db

gvim gvimrc at gmail.com
Thu Mar 17 07:52:11 PDT 2016


On 17/03/2016 10:06, Jon Wood wrote:
> If you've got things like views that need handling as well your best bet
> is probably Andrew's recommendation of setting the schema format to SQL
> - once you're building views you've lost the benefit of being able to
> migrate database engines anyway so there's no real benefit to
> translating all the SQL into Ruby.
>

Yes, I was worried about getting VIEWs working but it turned out to be 
pretty straightforward. Just create app/models/vmaster.rb containing:

class Vmaster < ActiveRecord::Base
     self.table_name = 'vmaster'
     self.primary_key = "id"
end

gvim



More information about the Chat mailing list