Foreign keys with Rails' ActiveRecord::Migration?

Posted by Earlz on Stack Overflow See other posts from Stack Overflow or by Earlz
Published on 2010-04-03T22:54:46Z Indexed on 2010/04/03 23:03 UTC
Read the original article Hit count: 518

Hello, I'm new to Ruby on Rails (I know Ruby just decently though) and looking at the Migration tools, it sounds really awesome. Database schemas can finally (easily) go in source control.

Now my problem with it. When using Postgres as the database, it does not setup foreign keys. I would like the benefits of foreign keys in my schema such as referential integrity. So how do I apply foreign keys with Migrations?

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about migrations