From e7adc624d6aefb40b88b41652d311592730d7049 Mon Sep 17 00:00:00 2001 From: jennylee Date: Fri, 16 May 2014 14:58:57 -0400 Subject: [PATCH] BUG-14945 Disable foreign keys verification when generating a backup. The statement SET FOREIGN_KEY_CHECKS=0; was added when the sql script is been generated, when backuping a workspace. This was added in case that a table in the database has a foreign key. When a table has a foreign key some operations are not allowed create/delete/update, because of the restrictions of the foreing key. So, to allow this operations we disabled the foreign key checks (SET FOREIGN_KEY_CHECKS=0;) until we have all the tables created in the database. --- gulliver/system/class.dbMaintenance.php | 1 + 1 file changed, 1 insertion(+) diff --git a/gulliver/system/class.dbMaintenance.php b/gulliver/system/class.dbMaintenance.php index d6ea58085..0c3d20cf8 100755 --- a/gulliver/system/class.dbMaintenance.php +++ b/gulliver/system/class.dbMaintenance.php @@ -500,6 +500,7 @@ class DataBaseMaintenance $schema .= " -- Tables: " . (count( $aTables )) . "\n"; $schema .= " -- Date: " . (date( 'l jS \of F Y h:i:s A' )) . "\n"; $schema .= " --\n\n"; + $schema .= "SET FOREIGN_KEY_CHECKS=0; \n\n"; $file = fopen( $outfile, "w+" );