I'm developing an application in rails and the following error appears in my bank at the time I try to perform a rake db: migrate. I have tried to give a drop in the bank and a create in sequence, however the same error happens. The curious thing is that it was working normally and there was no change in the "products" module of the application.
ActiveRecord :: StatementInvalid: PG :: UndefinedTable: ERROR: "Products" relationship does not exist LINE 5: WHERE a.attrelid = '"products"' :: regclass ^ : SELECT a.attname, format_type (a.atttypid, a.atttypmod), pg_get_expr (d.adbin, d.adrelid), a.attnotnull, a.atttypid, > a.atttypmod FROM pg_attribute to LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = '"products"' :: regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum
class CreateProducts < ActiveRecord::Migration
def change
create_table :products do |t|
t.references :type
t.string :mark
t.string :model
t.string :engine
t.text :description
t.string :barcode
t.timestamps
end
add_index :products, :type_id
end
end