rich icon indicating copy to clipboard operation
rich copied to clipboard

PG::UndefinedTable: ERROR: relation "owners" does not exist

Open servisof opened this issue 10 years ago • 3 comments

I followed the install instructions on readme but it gives the above-mentioned error when migrating. What's wrong? The platform is using:

ruby '1.9.3'
rails (3.2.13)
  actionmailer (= 3.2.13)
  actionpack (= 3.2.13)
  activerecord (= 3.2.13)
  activeresource (= 3.2.13)
  activesupport (= 3.2.13)
  bundler (~> 1.0)
  railties (= 3.2.13)

AND rich (1.4.6) jquery-rails kaminari mime-types paperclip rack-raw-upload rails (>= 3.2.0) sass-rails

The error is displayed as follows: seleccin_004

servisof avatar May 07 '14 21:05 servisof

Help, please. I cannot solve this alone!!!

servisof avatar May 10 '14 18:05 servisof

Did you tried with the latest version?

renews avatar Jun 18 '14 03:06 renews

Are you using schema_plus gem? In the log you posted I see, that postgres is trying to create a foreign key to the table owner, which doesn't exist, because this is a polymorphic relation.

I you are using schema_plus, than you can skip the foreign_key creation by changing the rich migration:

t.integer :owner_id, foreign_key: false

If you are not using schema_plus than you have to figure out, why the migration is trying to create a foreign key, AFAIK Rails do not do this.

Szeliga avatar Jul 16 '14 11:07 Szeliga