add index to image table to query by type
[lhc/web/wiklou.git] / includes / installer / MysqlUpdater.php
index da638de..d8fa64e 100644 (file)
@@ -228,6 +228,8 @@ class MysqlUpdater extends DatabaseUpdater {
                        array( 'addField', 'uploadstash',      'us_props',      'patch-uploadstash-us_props.sql' ),
                        array( 'modifyField', 'user_groups', 'ug_group', 'patch-ug_group-length-increase-255.sql' ),
                        array( 'modifyField', 'user_former_groups', 'ufg_group', 'patch-ufg_group-length-increase-255.sql' ),
+                       array( 'addIndex', 'page_props', 'pp_propname_page',  'patch-page_props-propname-page-index.sql' ),
+                       array( 'addIndex', 'image', 'img_media_mime', 'patch-img_media_mime-index.sql' ),
                );
        }
 
@@ -235,9 +237,9 @@ class MysqlUpdater extends DatabaseUpdater {
         * 1.4 betas were missing the 'binary' marker from logging.log_title,
         * which causes a collation mismatch error on joins in MySQL 4.1.
         *
-        * @param $table String: table name
-        * @param $field String: field name to check
-        * @param $patchFile String: path to the patch to correct the field
+        * @param string $table table name
+        * @param string $field field name to check
+        * @param string $patchFile path to the patch to correct the field
         */
        protected function checkBin( $table, $field, $patchFile ) {
                if ( !$this->doTable( $table ) ) {
@@ -258,9 +260,9 @@ class MysqlUpdater extends DatabaseUpdater {
        /**
         * Check whether an index contain a field
         *
-        * @param $table String: table name
-        * @param $index String: index name to check
-        * @param $field String: field that should be in the index
+        * @param string $table table name
+        * @param string $index index name to check
+        * @param string $field field that should be in the index
         * @return Boolean
         */
        protected function indexHasField( $table, $index, $field ) {
@@ -329,7 +331,7 @@ class MysqlUpdater extends DatabaseUpdater {
                }
 
                if( $this->applyPatch( 'patch-fix-il_from.sql', false, "Fixing ancient broken imagelinks table." ) ) {
-                       $this->output("NOTE: you will have to run maintenance/refreshLinks.php after this." );
+                       $this->output( "NOTE: you will have to run maintenance/refreshLinks.php after this." );
                }
        }
 
@@ -415,7 +417,7 @@ class MysqlUpdater extends DatabaseUpdater {
                                if ( $prev_title == $row->cur_title && $prev_namespace == $row->cur_namespace ) {
                                        $deleteId[] = $row->cur_id;
                                }
-                               $prev_title     = $row->cur_title;
+                               $prev_title = $row->cur_title;
                                $prev_namespace = $row->cur_namespace;
                        }
                        $sql = "DELETE FROM $cur WHERE cur_id IN ( " . join( ',', $deleteId ) . ')';