# Foreign key associations: best practices?

**URL:** <https://www.ruby-forum.com/t/foreign-key-associations-best-practices/178284>\
**Category:** Rails\
**Created:** [November 2, 2009, 6:11am UTC](https://www.ruby-forum.com/t/foreign-key-associations-best-practices/178284 "2009-11-02T06:11:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aaron\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e79b87/32.png) [@Aaron\_T](https://www.ruby-forum.com/u/Aaron_T)\
**Post date:** [November 2, 2009, 6:11am UTC](https://www.ruby-forum.com/t/foreign-key-associations-best-practices/178284/1 "2009-11-02T06:11:15Z")

</div>

Looks like [http://www.redhillonrails.org](http://www.redhillonrails.org) has been taken over by ads  
and considering how old the RedHill plugins are getting I was  
wondering if people are still using the RedHill foreign\_key\_migrations  
plugin to setup foreign key relationships? If not what are people  
using to replace it?

Thanks,  
Aaron

–  
Aaron T.  
[http://synfin.net/](http://synfin.net/)  
[http://tcpreplay.synfin.net/](http://tcpreplay.synfin.net/) - Pcap editing and replay tools for Unix &  
Windows  
Those who would give up essential Liberty, to purchase a little  
temporary  
Safety, deserve neither Liberty nor Safety.  
– Benjamin Franklin  
“carpe diem quam minimum credula postero”

---

<div class="post-metadata">

**Author:** ![Aaron\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e79b87/32.png) [@Aaron\_T](https://www.ruby-forum.com/u/Aaron_T)\
**Post date:** [November 2, 2009, 4:35pm UTC](https://www.ruby-forum.com/t/foreign-key-associations-best-practices/178284/2 "2009-11-02T16:35:16Z")

</div>

Aaron T. wrote:

> Looks like [http://www.redhillonrails.org](http://www.redhillonrails.org) has been taken over by ads  
> and considering how old the RedHill plugins are getting I was  
> wondering if people are still using the RedHill foreign\_key\_migrations  
> plugin to setup foreign key relationships? If not what are people  
> using to replace it?

I still use foreign\_key\_migrations. The RedHill stuff is now at  
[harukizaemon (Simon Harris) · GitHub](http://github.com/harukizaemon) .

> Thanks,  
> Aaron
> 
> –  
> Aaron T.  
> [http://synfin.net/](http://synfin.net/)  
> [http://tcpreplay.synfin.net/](http://tcpreplay.synfin.net/) - Pcap editing and replay tools for Unix &  
> Windows  
> Those who would give up essential Liberty, to purchase a little  
> temporary  
> Safety, deserve neither Liberty nor Safety.  
> – Benjamin Franklin  
> “carpe diem quam minimum credula postero”

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![Aaron\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e79b87/32.png) [@Aaron\_T](https://www.ruby-forum.com/u/Aaron_T)\
**Post date:** [November 2, 2009, 8:01pm UTC](https://www.ruby-forum.com/t/foreign-key-associations-best-practices/178284/3 "2009-11-02T20:01:50Z")

</div>

I’m using foreigner. It works great for me. Foreign keys get correctly  
put into schema.db and everything.

> **[GitHub - matthuhiggins/foreigner: Adds foreign key helpers to migrations and...](https://github.com/matthuhiggins/foreigner)**
>
> Adds foreign key helpers to migrations and correctly dumps foreign keys to schema.rb - GitHub - matthuhiggins/foreigner: Adds foreign key helpers to migrations and correctly dumps foreign keys to s...

On Nov 2, 7:35 am, Marnen Laibow-Koser \<rails-mailing-l…@andreas-

---

<div class="post-metadata">

**Author:** ![Aaron\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e79b87/32.png) [@Aaron\_T](https://www.ruby-forum.com/u/Aaron_T)\
**Post date:** [November 2, 2009, 8:17pm UTC](https://www.ruby-forum.com/t/foreign-key-associations-best-practices/178284/4 "2009-11-02T20:17:01Z")

</div>

Scott J. wrote:

> I’m using foreigner. It works great for me. Foreign keys get correctly  
> put into schema.db and everything.
> 
> [GitHub - matthuhiggins/foreigner: Adds foreign key helpers to migrations and correctly dumps foreign keys to schema.rb](http://github.com/matthuhiggins/foreigner)
> 
> On Nov 2, 7:35 am, Marnen Laibow-Koser \<rails-mailing-l…@andreas-

I’m glad to know about Foreigner; I hadn’t heard of it. I think I like  
foreign\_key\_migrations’ approach slightly better, but I’ll have to try  
Foreigner.

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid
