<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Zend Framework Blog &#187; Foreign keys</title>
	<atom:link href="http://blog.richardknop.com/tag/foreign-keys/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.richardknop.com</link>
	<description>Zend Framework, PHP, Django, Python, SQL, MySQL, PostgreSQL, Oracle, PL/SQL, data model patterns, OOP, design patterns, JavaScript, jQuery, HTML, XHTML, CSS, XML, web services &#38; APIs, Security, E-commerce and much more</description>
	<lastBuildDate>Sat, 04 Feb 2012 19:47:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>#1005 &#8211; Can&#8217;t create table &#8216;database_name.table_name&#8217; (errno: 150)</title>
		<link>http://blog.richardknop.com/2009/07/1005-cant-create-table-database_name-table_name-errno-150/</link>
		<comments>http://blog.richardknop.com/2009/07/1005-cant-create-table-database_name-table_name-errno-150/#comments</comments>
		<pubDate>Sun, 19 Jul 2009 22:20:40 +0000</pubDate>
		<dc:creator>Richard Knop</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Foreign keys]]></category>
		<category><![CDATA[InnoDB]]></category>

		<guid isPermaLink="false">http://blog.richardknop.com/?p=444</guid>
		<description><![CDATA[When you are working with MySQL InnoDB table engine and especially foreign keys (as I do) you will encounter a similar error message quite often. Tracking down where exactly lies the problem can be very frustrating as the error message isn&#8217;t very suggestive. From my experience, the problem is 99% of the time with foreign [...]]]></description>
			<content:encoded><![CDATA[<p>When you are working with MySQL InnoDB table engine and especially foreign keys (as I do) you will encounter a similar error message quite often. Tracking down where exactly lies the problem can be very frustrating as the error message isn&#8217;t very suggestive.</p>
<p>From my experience, the problem is 99% of the time with foreign keys. Here are three most common reasons I have come across:</p>
<ul>
<li>the two fields in the foreign key relationship are not exactly the same type (for example one is TEXT and another is VARCHAR)</li>
<li>although the two fields are the same type they aren&#8217;t the same size (for example one is INT(10) and another is INT(4))</li>
<li>the field you are referencing with the foreign key has no index (if the field is not a primary key you must add index to it)</li>
</ul>
<p>I hope this might be helpfull to someone who comes across a similar error message.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.richardknop.com/2009/07/1005-cant-create-table-database_name-table_name-errno-150/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

