Forum: Ruby on Rails rake db:schema:dump doesn't produce composite primary key instructions

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Tim H. (Guest)
on 2009-05-26 09:42
(Received via mailing list)
Hey there,

I've adjusted some of my many to many join tables recently to use a
composite primary key based on the id's in the two columns - instead
of using a surrogate key.

I just did a db:schema:dump, and it looks something like this:

  create_table "class_members", :id => false, :force => true do |t|
    t.integer "user_id",  :default => 0, :null => false
    t.integer "class_id", :default => 0, :null => false
  end

So it knows to exclude the id, but it has no information on the
primary key.

Is this a bug, or is there a good reason for it?

Cheers,

Tim.
This topic is locked and can not be replied to.