Hi there… sorry if this is a double post. I tried posting this
earlier and can’t see the listing for it.
I’ve created the following model files…
class Cartclass < ActiveRecord::Base
belongs_to :product
end
class Carttype < ActiveRecord::Base
belongs_to :product
end
class Manufacturer < ActiveRecord::Base
belongs_to :product
end
class Product < ActiveRecord::Base
has_one :manufacturer
has_one :carttype
has_one :cartclass
end
… and added the following migration script…
class CreateProducts < ActiveRecord::Migration
def self.up
create_table :products do |t|
t.column :name, :string
t.column :carttype_id, :integer
t.column :cartclass_id, :integer
t.column :manufacturer_id, :integer
t.column :shortnum, :string
t.column :partnumber, :string
t.column :boxnumber, :string
t.column :stock, :string
t.column :colour, :string
end
end
def self.down
drop_table :products
end
end
… but when I try running rake db:migrate, it seems to completely skip
over this without creating a table. No error messages or anything.
Am I missing something?
Thanks,
Brandon