Automatic Key Migrations is a gem that automatically generates foreign-key constraints when creating tables. It uses SQL-92 syntax and as such should be compatible with most databases that support foreign-key constraints.
Michał Łomnicki
gem "automatic_foreign_key", "~> 1.0.5"