<p>This turns off foreign key constraint checking in MySQL not only for CREATE TABLE but also for ALTER TABLE and DROP TABLE.</p>
<p>This is because ALTER TABLE and DROP TABLE may also result in errors due to foreign key constraint checking.</p>
<p>Changed the process of changing the foreign_key_checks variable from before and after CREATE TABLE to before and after the entire diff.</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>&nbsp;&nbsp;<a href='https://github.com/dbsrgits/sql-translator/pull/135'>https://github.com/dbsrgits/sql-translator/pull/135</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>Turn off foreign key checking in MySQL.</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/dbsrgits/sql-translator/pull/135/files#diff-d1a0629b4bf9c95c1131cc9eaadd08c23943af65ad4b679de4b8190ee019a87b">lib/SQL/Translator/Diff.pm</a>
    (6)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/dbsrgits/sql-translator/pull/135/files#diff-d4b122b2ebfb3ec11859528d95772379d92bbad84dc2446d0637fd88ea6d54f3">lib/SQL/Translator/Producer/MySQL.pm</a>
    (14)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/dbsrgits/sql-translator/pull/135/files#diff-68f87aa59870ab66085c31dc87d1abb14cbbaff4e8156a516d09a12fe647f231">t/30sqlt-new-diff-mysql.t</a>
    (24)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/dbsrgits/sql-translator/pull/135/files#diff-a3ef965729bd28918717d6408dedbb18cb4089fdd07270ff6dc3d815aafe42a4">t/38-mysql-producer.t</a>
    (4)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/dbsrgits/sql-translator/pull/135/files#diff-083edd5f6f93294c04d2001a224bd1258fd0a2b31cbd0fe8230d9f957dde8380">t/64xml-to-mysql.t</a>
    (4)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/dbsrgits/sql-translator/pull/135.patch'>https://github.com/dbsrgits/sql-translator/pull/135.patch</a></li>
  <li><a href='https://github.com/dbsrgits/sql-translator/pull/135.diff'>https://github.com/dbsrgits/sql-translator/pull/135.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/dbsrgits/sql-translator/pull/135">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AACJ4AXGCYD7ZPISMGKLHZDTHZSX3ANCNFSM42UCY2YA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AACJ4AVGPONFU7VSNN2DWOTTHZSX3A5CNFSM42UCY2YKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4MXIRW4A.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/dbsrgits/sql-translator/pull/135",
"url": "https://github.com/dbsrgits/sql-translator/pull/135",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>