Merge "Avoid 'message' in log context in AuthManager"
[lhc/web/wiklou.git] / includes / installer / MysqlUpdater.php
index 6989969..497f273 100644 (file)
@@ -155,7 +155,6 @@ class MysqlUpdater extends DatabaseUpdater {
                        [ 'addField', 'ipblocks', 'ipb_allow_usertalk', 'patch-ipb_allow_usertalk.sql' ],
 
                        // 1.15
-                       [ 'doUniquePlTlIl' ],
                        [ 'addTable', 'change_tag', 'patch-change_tag.sql' ],
                        [ 'addTable', 'tag_summary', 'patch-tag_summary.sql' ],
                        [ 'addTable', 'valid_tag', 'patch-valid_tag.sql' ],
@@ -287,7 +286,10 @@ class MysqlUpdater extends DatabaseUpdater {
                        // 1.28
                        [ 'addIndex', 'recentchanges', 'rc_name_type_patrolled_timestamp',
                                'patch-add-rc_name_type_patrolled_timestamp_index.sql' ],
-                       [ 'doRevisionPageRevIndexNonUnique' ]
+                       [ 'doRevisionPageRevIndexNonUnique' ],
+                       [ 'doNonUniquePlTlIl' ],
+                       [ 'addField', 'change_tag', 'ct_id', 'patch-change_tag-ct_id.sql' ],
+                       [ 'addField', 'tag_summary', 'ts_id', 'patch-tag_summary-ts_id.sql' ],
                ];
        }
 
@@ -974,24 +976,24 @@ class MysqlUpdater extends DatabaseUpdater {
                return true;
        }
 
-       protected function doUniquePlTlIl() {
+       protected function doNonUniquePlTlIl() {
                $info = $this->db->indexInfo( 'pagelinks', 'pl_namespace' );
-               if ( is_array( $info ) && !$info[0]->Non_unique ) {
-                       $this->output( "...pl_namespace, tl_namespace, il_to indices are already UNIQUE.\n" );
+               if ( is_array( $info ) && $info[0]->Non_unique ) {
+                       $this->output( "...pl_namespace, tl_namespace, il_to indices are already non-UNIQUE.\n" );
 
                        return true;
                }
                if ( $this->skipSchema ) {
                        $this->output( "...skipping schema change (making pl_namespace, tl_namespace " .
-                               "and il_to indices UNIQUE).\n" );
+                               "and il_to indices non-UNIQUE).\n" );
 
                        return false;
                }
 
                return $this->applyPatch(
-                       'patch-pl-tl-il-unique.sql',
+                       'patch-pl-tl-il-nonunique.sql',
                        false,
-                       'Making pl_namespace, tl_namespace and il_to indices UNIQUE'
+                       'Making pl_namespace, tl_namespace and il_to indices non-UNIQUE'
                );
        }
 
@@ -1122,4 +1124,18 @@ class MysqlUpdater extends DatabaseUpdater {
                        'Making rev_page_id index non-unique'
                );
        }
+
+       public function getSchemaVars() {
+               global $wgDBTableOptions;
+
+               $vars = [];
+               $vars['wgDBTableOptions'] = str_replace( 'TYPE', 'ENGINE', $wgDBTableOptions );
+               $vars['wgDBTableOptions'] = str_replace(
+                       'CHARSET=mysql4',
+                       'CHARSET=binary',
+                       $vars['wgDBTableOptions']
+               );
+
+               return $vars;
+       }
 }