I tested an association on mysql as follows and it works:
User.campaigns
These are the associations in the Models:
Campaign belongs_to :user
User has_many :campaigns
However, when I run it on heroku which uses Postgres, I get the following:
CampaignsController#index (ActiveRecord::StatementInvalid) "PGError: ERROR: column campaigns.user_id does not exist\nLINE 1: SELECT * FROM \"campaigns\" WHERE (\"campaigns\".user_id = 1) \n ^\n: SELECT * FROM \"cam
This is a little worrying because -- if the way I use rails associations depends on the database...hmm...not sure how I can effectively doing any development...thoughts?
From stackoverflow
-
Your error indicates the column doesn't exist. Have you run the migrations on Heroku?
$ heroku rake db:migrate
Angela : Hi, yeah, I did run them....seemed okay, then ran it again and got an error not related to this model....Angela : hmm...thinking maybe the migration didn't run completely then...will check, it looked like it did locally though
0 comments:
Post a Comment