title: Primary key is not allowed in a has_and_belongs_to_many join table
body: <p>I have many-to-many linking table between two entities, datacenters and projects,
  in legacy code.  I discovered, that it's really a one to many relationship.</p>
  
  <p>As a first step to cleaning up the relationship, I wanted to put a unique index
  on one of the fields.</p>
  
  <p>Now I'm getting the following error:</p>
  
  <p>Primary key is not allowed in a has_and_belongs_to_many join table (datacenters_projects).</p>
  
  <p>I'm using Rails 2.3.8 running on ruby 1.8.7p174 and mysql  Ver 14.12 Distrib 5.0.77.</p>
  
  <p>This is not a primary key, it's just a unique index.
  I suppose it's a candidate key, but I haven't decided it is a primary key.</p>
  
  <p>I don't know why mysql considers this to be a primary key.
  I don't know why ActiveRecord would object to the linking table in a
  has_and_belongs_to_many having a primary key.</p>
  
  <p>But my real question is, "Is there any way I can put a unique index on 
  one of the fields, without ActiveRecord giving me an error?"</p>
  
  <p>Is there any way I can tell add_index that this is not a primary key?</p>