<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'>> @@ -457,11 +457,17 @@ sub create_table
> #
> my @constraint_defs;
> my @constraints = $table->get_constraints;
> +
> + # Get the primary key, if there is one. No need to create an index for an
> + # FK that is also the PK. It may be a multi-field key, so generate a
> + # suitable string for comparison.
> + my $pk = join "\0", map $_->fields, grep $_->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;">—<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>