Make sure that the migration file’s prefix number is smaller than the
value in your schema_info table in your database. Rails uses this number
to determine which migrations are yet to be run. This assumes you’ve ran
migrations before, if you haven’t you won’t have a schema_info table and
I have no idea what the problem may be
Also, I notice that your belongs_to statements are in your Carttype,
Cartclass and Manufacturer models, but you’re creating the foreign keys
in your products table. AFAIK, foreign keys go in the table
corresponding to the belongs_to statement (as with has_many and
belongs_to).
Thanks very much, I’ll take a look at that later today.
Why does that seem counter-intuitive? If my cartclass, carttype and
manufacturer tables are lookup items for a product, I would consider
them
children of the product, normally… wouldn’t it make sense for these
child
items to belong to the parent?
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.