<p>In <a href="https://github.com/dbsrgits/sql-translator/pull/56#discussion_r33819591">lib/SQL/Translator/Producer/MySQL.pm</a>:</p>
<pre style='color:#555'>&gt; @@ -457,11 +457,17 @@ sub create_table
&gt;      #
&gt;      my @constraint_defs;
&gt;      my @constraints = $table-&gt;get_constraints;
&gt; +
&gt; +    # Get the primary key, if there is one. No need to create an index for an
&gt; +    # FK that is also the PK. It may be a multi-field key, so generate a
&gt; +    # suitable string for comparison.
&gt; +    my $pk = join &quot;\0&quot;, map $_-&gt;fields, grep $_-&gt;type eq PRIMARY_KEY, @constraints;
</pre>
<p>Indeed. Looks like the code in master doesn't handle multi-column foreign keys, either. I'll update the PR incorporating your suggestion and fix that.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href="https://github.com/dbsrgits/sql-translator/pull/56/files#r33819591">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AASeAiSJyL0wkVex3Z32f55Q0ADF4Rcaks5oZZcJgaJpZM4ElEZI.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
  <div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
    <link itemprop="url" href="https://github.com/dbsrgits/sql-translator/pull/56/files#r33819591"></link>
    <meta itemprop="name" content="View Pull Request"></meta>
  </div>
  <meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>