I decided to try a rails project again… something I do quite frequently after I've completely forgotten everything I've learned.
One thing I quickly remembered is that there is no easy way in a migration to create constraints, like a foreign key. You have to do some exec silliness with an actual query.
After some quick searching, I found this plugin: http://rubyforge.org/projects/mig-constraints
(more…)