1. Konstantine Rybnikov
  2. south with list of databases under migration support


Andrew Godwin  committed e1867ac

Fixed #967: Set foreign key checks to 0 at the start of every transaction on MySQL.

  • Participants
  • Parent commits 24cadba
  • Branches default

Comments (0)

Files changed (1)

File south/db/mysql.py

View file
         cursor = self._get_connection().cursor()
         if self._has_setting('STORAGE_ENGINE') and self._get_setting('STORAGE_ENGINE'):
             cursor.execute("SET storage_engine=%s;" % self._get_setting('STORAGE_ENGINE'))
-        # Turn off foreign key checks, and turn them back on at the end
-        cursor.execute("SET FOREIGN_KEY_CHECKS=0;")
-        self.deferred_sql.append("SET FOREIGN_KEY_CHECKS=1;")
+    def start_transaction(self):
+        super(DatabaseOperations, self).start_transaction()
+        self.execute("SET FOREIGN_KEY_CHECKS=0;")