Ruby on Rails Sunday, November 21, 2010

Marnen Laibow-Koser wrote in post #962137:

> Working without foreign key constraints is playing with fire. It may
> look like it is working, but you'll be setting yourself up for subtle
> bugs that may not be immediately obvious but will cause you no end of
> grief when they occur. Don't ever do that.
>
> Moral: if you care about the integrity of your data, you need physical
> constraints in the DB to ensure that integrity. If you don't care about
> that integrity, don't waste time storing the data. :)
>

Hi,

In reference to the above, I happen to come across the "Advanced Rails
Recipes" book from Mike Clark. Recipe Nr. 8 in the book is called "Add
Foreign Key Constraints", explaining how to add foreign key constaraints
to the database to ensure referntial integrity using the 'execute'
method. I assume this would then be sufficient to prevent manual doings
directly in the DB. Any experience with this ?.

Regards,
Dani

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment