[Fusionforge-commits] r14839 - in trunk: . src/db

Roland Mas lolando at fusionforge.org
Thu Nov 17 20:52:30 CET 2011


Author: lolando
Date: 2011-11-17 20:52:30 +0100 (Thu, 17 Nov 2011)
New Revision: 14839

Modified:
   trunk/
   trunk/src/db/upgrade-db.php
Log:
Run scripts within DB transactions

Modified: trunk/src/db/upgrade-db.php
===================================================================
--- trunk/src/db/upgrade-db.php	2011-11-17 19:52:21 UTC (rev 14838)
+++ trunk/src/db/upgrade-db.php	2011-11-17 19:52:30 UTC (rev 14839)
@@ -55,6 +55,7 @@
 				exit(1);
 			} else if (db_numrows($res) == 0) {
 				show("Running script: {$script['filename']}\n");
+				db_begin();
 				$result = run_script($script);
 				if ($result) {
 					$res = db_query_params ('INSERT INTO database_changes (filename) VALUES ($1)',
@@ -64,6 +65,7 @@
 						show("ERROR-3: ".db_error()."\n");
 						exit(1);
 					}
+					db_commit();
 				} else {
 					// error
 					exit(1);




More information about the Fusionforge-commits mailing list