Forum: Ruby on Rails Many-to-Many Migration with Index

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
05ad85947c83ee3412f1be72d9d4ab29?d=identicon&s=25 Mithrill (Guest)
on 2007-02-25 19:46
(Received via mailing list)
The answer to this question is probably really simple, but I'm fairly
new to rails and can't find any detailed information  about this
subject--not even in the Agile Web Development with Rails Book (2nd

The questions deal with many-to-many relationships in rails. I've got
some database background so the concept of many-to-many isn't foreign
to me.

First off, should I create all three tables (vehicles, features, and
features_vehicles) in a single migration?
If so, should I create the migration as "ruby script/generate
migration features_vehicles"?
Assuming I'm correct so far, what do I need to do for the vehicle and
feature models (since Rails didn't auto-create these because I used
generate migration for 3 tables rather than generate model for each
part of the many-to-many table)?

Any and all help will be greatly appreciated. If anyone knows of a
good up-to-date tutorial (for Rails 1.2+), please share. Thanks in
advance for your help!
This topic is locked and can not be replied to.