<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>
<channel>
	<title>Comments on: Rails with foreign key constraints</title>
	<atom:link href="http://blog.amber.org/2006/05/01/rails-with-foreign-key-constraints/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.amber.org/2006/05/01/rails-with-foreign-key-constraints/</link>
	<description>Thoughts of a minor lunatic</description>
	<pubDate>Wed, 07 Jan 2009 19:09:17 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Lawrence</title>
		<link>http://blog.amber.org/2006/05/01/rails-with-foreign-key-constraints/comment-page-1/#comment-10580</link>
		<dc:creator>Lawrence</dc:creator>
		<pubDate>Wed, 14 Jun 2006 05:51:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.amber.org/2006/05/01/rails-with-foreign-key-constraints/#comment-10580</guid>
		<description>I agree as well -- I would have migrated from a legacy PHP-wrapped system already, but I expected Rails to be more sensible about foreign keys.</description>
		<content:encoded><![CDATA[<p>I agree as well&#8212;I would have migrated from a legacy PHP-wrapped system already, but I expected Rails to be more sensible about foreign keys.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John</title>
		<link>http://blog.amber.org/2006/05/01/rails-with-foreign-key-constraints/comment-page-1/#comment-6910</link>
		<dc:creator>John</dc:creator>
		<pubDate>Tue, 09 May 2006 12:06:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.amber.org/2006/05/01/rails-with-foreign-key-constraints/#comment-6910</guid>
		<description>I totally agree with you on the MySQL influence on Rails, which I think otherwise is a fantastic framework.

I'm developing a do-over of a fairly complex system from PHP/Postgresql in Rails, and so far the biggest snag I've run into is the way that Rails assumes I am building columns such as "Type", and "Status" into my tables as simple varchars. This is the wrong way to do it. Instead, "Type" and "Status" columns should be integers referencing foreign keys in respective "Types" and "Statuses" tables. The application code should never be responsible for data integrity at this level. Not only should the database do this, it's built to do it.

What this means for me in Rails, is that many of the nice automagic features, such as Single Table Inheritance, only half-work.

I am however starting to think about patching ActiveRecord to support a more proper way of doing things.</description>
		<content:encoded><![CDATA[<p>I totally agree with you on the MySQL influence on Rails, which I think otherwise is a fantastic framework.</p>
<p>I&#8217;m developing a do-over of a fairly complex system from PHP/Postgresql in Rails, and so far the biggest snag I&#8217;ve run into is the way that Rails assumes I am building columns such as &#8220;Type&#8221;, and &#8220;Status&#8221; into my tables as simple varchars. This is the wrong way to do it. Instead, &#8220;Type&#8221; and &#8220;Status&#8221; columns should be integers referencing foreign keys in respective &#8220;Types&#8221; and &#8220;Statuses&#8221; tables. The application code should never be responsible for data integrity at this level. Not only should the database do this, it&#8217;s built to do it.</p>
<p>What this means for me in Rails, is that many of the nice automagic features, such as Single Table Inheritance, only half-work.</p>
<p>I am however starting to think about patching ActiveRecord to support a more proper way of doing things.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
