I worked on a plugin yesterday that would include all of our migration helpers. You can find it on github. Currently, it only does foreign keys work, but eventually, I’d like to have it add unique indexes on columns defined with a :unique => true attribute in the ActiveRecord migration. But for right now, here’s how to use it:
Adding a foreign key that references the id column in another table:
# The column 'id' is assumed in the referenced table. add_foreign_key :table1, :table2_ref, :table2


