An article about using has_and_belongs_to_many with migrations. They say to:
create_table :table_name, :id => false do |table|
...
end
Here's a more fleshed out example:
create_table :exercises_types, :id => false do |t|
t.column "exercise_id", :integer
t.column "type_id", :integer
end