Merge "Update mediawiki/mediawiki-codesniffer to 0.8.1"
[lhc/web/wiklou.git] / includes / installer / MssqlUpdater.php
index dfe595e..1a9915d 100644 (file)
@@ -114,7 +114,9 @@ class MssqlUpdater extends DatabaseUpdater {
 
        /**
         * General schema update for a table that touches more than one field or requires
-        * destructive actions (such as dropping and recreating the table).
+        * destructive actions (such as dropping and recreating the table). NOTE: Usage of
+        * this function is highly discouraged, use it's successor DatabaseUpdater::modifyTable
+        * instead.
         *
         * @param string $table
         * @param string $updatekey
@@ -127,9 +129,11 @@ class MssqlUpdater extends DatabaseUpdater {
                } elseif ( $this->updateRowExists( $updatekey ) ) {
                        $this->output( "...$table already had schema updated by $patch.\n" );
                } else {
-                       $this->insertUpdateRow( $updatekey );
-
-                       return $this->applyPatch( $patch, $fullpath, "Updating schema of table $table" );
+                       $apply = $this->applyPatch( $patch, $fullpath, "Updating schema of table $table" );
+                       if ( $apply ) {
+                               $this->insertUpdateRow( $updatekey );
+                       }
+                       return $apply;
                }
 
                return true;