rails/rails — pull request #5262 by joshuap (2012-03-03 22:26:10+00:00)
Title: Automatically create indexes for references/belongs_to statements in migrations.

My attempt at solving an annoyance mentioned a couple weeks ago by @tenderlove, where using "references" or "belongs_to" when creating/changing a table in a migration does not create a corresponding index, even though in most cases it is needed.

One consideration is that most developers will have already specified indexes for these columns in their existing migrations... I'm not sure if that will be a problem or not moving forward. I'm happy to make additional changes if need be.