X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=blobdiff_plain;f=includes%2Finstaller%2FMysqlUpdater.php;h=c3dedbcbdbda3b557b7139cc160e77971beeb00c;hb=5d9b67e09ed150f342b17383e53cc0d4be1ba754;hp=dcf37b68a3060d417b984b44815fe7b2d3cd89f9;hpb=5ba12e2896a71d5ae8be2f404934e2dbe1f0abbc;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/installer/MysqlUpdater.php b/includes/installer/MysqlUpdater.php index dcf37b68a3..36d2c1dd31 100644 --- a/includes/installer/MysqlUpdater.php +++ b/includes/installer/MysqlUpdater.php @@ -37,7 +37,6 @@ class MysqlUpdater extends DatabaseUpdater { array( 'addField', 'ipblocks', 'ipb_expiry', 'patch-ipb_expiry.sql' ), array( 'doInterwikiUpdate' ), array( 'doIndexUpdate' ), - array( 'addTable', 'hitcounter', 'patch-hitcounter.sql' ), array( 'addField', 'recentchanges', 'rc_type', 'patch-rc_type.sql' ), array( 'addIndex', 'recentchanges', 'new_name_timestamp', 'patch-rc-newindex.sql' ), @@ -254,11 +253,26 @@ class MysqlUpdater extends DatabaseUpdater { // 1.24 array( 'addField', 'page_props', 'pp_sortkey', 'patch-pp_sortkey.sql' ), array( 'dropField', 'recentchanges', 'rc_cur_time', 'patch-drop-rc_cur_time.sql' ), - array( 'addIndex', 'watchlist', 'wl_user_notificationtimestamp', 'patch-watchlist-user-notificationtimestamp-index.sql' ), + array( 'addIndex', 'watchlist', 'wl_user_notificationtimestamp', + 'patch-watchlist-user-notificationtimestamp-index.sql' ), array( 'addField', 'page', 'page_lang', 'patch-page_lang.sql' ), array( 'addField', 'pagelinks', 'pl_from_namespace', 'patch-pl_from_namespace.sql' ), array( 'addField', 'templatelinks', 'tl_from_namespace', 'patch-tl_from_namespace.sql' ), array( 'addField', 'imagelinks', 'il_from_namespace', 'patch-il_from_namespace.sql' ), + array( 'modifyField', 'image', 'img_major_mime', + 'patch-img_major_mime-chemical.sql' ), + array( 'modifyField', 'oldimage', 'oi_major_mime', + 'patch-oi_major_mime-chemical.sql' ), + array( 'modifyField', 'filearchive', 'fa_major_mime', + 'patch-fa_major_mime-chemical.sql' ), + + // 1.25 + array( 'dropTable', 'hitcounter' ), + array( 'dropField', 'site_stats', 'ss_total_views', 'patch-drop-ss_total_views.sql' ), + array( 'dropField', 'page', 'page_counter', 'patch-drop-page_counter.sql' ), + array( 'doUserNewTalkUseridUnsigned' ), + // note this patch covers other _comment and _description fields too + array( 'modifyField', 'recentchanges', 'rc_comment', 'patch-editsummary-length.sql' ), ); } @@ -509,7 +523,6 @@ class MysqlUpdater extends DatabaseUpdater { page_namespace int NOT NULL, page_title varchar(255) binary NOT NULL, page_restrictions tinyblob NOT NULL, - page_counter bigint(20) unsigned NOT NULL default '0', page_is_redirect tinyint(1) unsigned NOT NULL default '0', page_is_new tinyint(1) unsigned NOT NULL default '0', page_random real unsigned NOT NULL, @@ -591,9 +604,9 @@ class MysqlUpdater extends DatabaseUpdater { $this->output( "......Setting up page table.\n" ); $this->db->query( "INSERT INTO $page (page_id, page_namespace, page_title, - page_restrictions, page_counter, page_is_redirect, page_is_new, page_random, + page_restrictions, page_is_redirect, page_is_new, page_random, page_touched, page_latest, page_len) - SELECT cur_id, cur_namespace, cur_title, cur_restrictions, cur_counter, + SELECT cur_id, cur_namespace, cur_title, cur_restrictions, cur_is_redirect, cur_is_new, cur_random, cur_touched, rev_id, LENGTH(cur_text) FROM $cur,$revision WHERE cur_id=rev_page AND rev_timestamp=cur_timestamp AND rev_id > {$maxold}", @@ -917,18 +930,6 @@ class MysqlUpdater extends DatabaseUpdater { } } - protected function doEnableProfiling() { - global $wgProfileToDatabase; - - if ( !$this->doTable( 'profiling' ) ) { - return true; - } - - if ( $wgProfileToDatabase === true && !$this->db->tableExists( 'profiling', __METHOD__ ) ) { - $this->applyPatch( 'patch-profiling.sql', false, 'Add profiling table' ); - } - } - protected function doMaybeProfilingMemoryUpdate() { if ( !$this->doTable( 'profiling' ) ) { return true; @@ -1064,4 +1065,26 @@ class MysqlUpdater extends DatabaseUpdater { 'Making iwl_prefix_title_from index non-UNIQUE' ); } + + protected function doUserNewTalkUseridUnsigned() { + if ( !$this->doTable( 'user_newtalk' ) ) { + return true; + } + + $info = $this->db->fieldInfo( 'user_newtalk', 'user_id' ); + if ( $info === false ) { + return true; + } + if ( $info->isUnsigned() ) { + $this->output( "...user_id is already unsigned int.\n" ); + + return true; + } + + return $this->applyPatch( + 'patch-user-newtalk-userid-unsigned.sql', + false, + 'Making user_id unsigned int' + ); + } }