array( 'addTable', 'logging', 'patch-logging.sql' ),
array( 'addField', 'user', 'user_token', 'patch-user_token.sql' ),
array( 'do_watchlist_update' ),
- array( 'do_user_update' ),
+ array( 'dropField', 'user', 'user_emailauthenticationtimestamp', 'patch-email-authentication.sql' ),
// 1.5
array( 'do_schema_restructuring' ),
array( 'addField', 'logging', 'log_params', 'patch-log_params.sql' ),
- array( 'check_bin', 'logging', 'log_title', 'patch-logging-title.sql', ),
+ array( 'check_bin', 'logging', 'log_title', 'patch-logging-title.sql', ),
array( 'addField', 'archive', 'ar_rev_id', 'patch-archive-rev_id.sql' ),
array( 'addField', 'page', 'page_len', 'patch-page_len.sql' ),
- array( 'do_inverse_timestamp' ),
- array( 'do_text_id' ),
+ array( 'dropField', 'revision', 'inverse_timestamp', 'patch-inverse_timestamp.sql' ),
+ array( 'addField', 'revision', 'rev_text_id', 'patch-rev_text_id.sql' ),
array( 'addField', 'revision', 'rev_deleted', 'patch-rev_deleted.sql' ),
array( 'addField', 'image', 'img_width', 'patch-img_width.sql' ),
array( 'addField', 'image', 'img_metadata', 'patch-img_metadata.sql' ),
array( 'doNamespaceSize' ),
array( 'addField', 'image', 'img_media_type', 'patch-img_media_type.sql' ),
array( 'do_pagelinks_update' ),
- array( 'do_drop_img_type' ),
+ array( 'dropField', 'image', 'img_type', 'patch-drop_img_type.sql' ),
array( 'do_user_unique_update' ),
array( 'do_user_groups_update' ),
array( 'addField', 'site_stats', 'ss_total_pages', 'patch-ss_total_articles.sql' ),
// 1.6
array( 'do_watchlist_null' ),
- array( 'do_logging_timestamp_index' ),
+ array( 'addIndex', 'logging', 'times', 'patch-logging-times-index.sql' ),
array( 'addField', 'ipblocks', 'ipb_range_start', 'patch-ipb_range_start.sql' ),
array( 'do_page_random_update' ),
array( 'addField', 'user', 'user_registration', 'patch-user_registration.sql' ),
array( 'addField', 'ipblocks', 'ipb_block_email', 'patch-ipb_emailban.sql' ),
array( 'do_categorylinks_indices_update' ),
array( 'addField', 'oldimage', 'oi_metadata', 'patch-oi_metadata.sql' ),
- array( 'do_archive_user_index' ),
- array( 'do_image_user_index' ),
- array( 'do_oldimage_user_index' ),
+ array( 'addIndex', 'archive', 'usertext_timestamp', 'patch-archive-user-index.sql' ),
+ array( 'addIndex', 'image', 'img_usertext_timestamp', 'patch-image-user-index.sql' ),
+ array( 'addIndex', 'oldimage', 'oi_usertext_timestamp', 'patch-oldimage-user-index.sql' ),
array( 'addField', 'archive', 'ar_page_id', 'patch-archive-page_id.sql' ),
array( 'addField', 'image', 'img_sha1', 'patch-img_sha1.sql' ),
}
}
-function do_logging_timestamp_index() {
- global $wgDatabase;
- if ( $wgDatabase->indexExists( 'logging', 'times' ) ) {
- wfOut( "...timestamp key on logging already exists.\n" );
- } else {
- wfOut( "Adding timestamp key on logging table... " );
- $wgDatabase->sourceFile( archive( "patch-logging-times-index.sql" ) );
- wfOut( "ok\n" );
- }
-}
-
-function do_archive_user_index() {
- global $wgDatabase;
- if ( $wgDatabase->indexExists( 'archive', 'usertext_timestamp' ) ) {
- wfOut( "...usertext,timestamp key on archive already exists.\n" );
- } else {
- wfOut( "Adding usertext,timestamp key on archive table... " );
- $wgDatabase->sourceFile( archive( "patch-archive-user-index.sql" ) );
- wfOut( "ok\n" );
- }
-}
-
-function do_image_user_index() {
- global $wgDatabase;
- if ( $wgDatabase->indexExists( 'image', 'img_usertext_timestamp' ) ) {
- wfOut( "...usertext,timestamp key on image already exists.\n" );
- } else {
- wfOut( "Adding usertext,timestamp key on image table... " );
- $wgDatabase->sourceFile( archive( "patch-image-user-index.sql" ) );
- wfOut( "ok\n" );
- }
-}
-
-function do_oldimage_user_index() {
- global $wgDatabase;
- if ( $wgDatabase->indexExists( 'oldimage', 'oi_usertext_timestamp' ) ) {
- wfOut( "...usertext,timestamp key on oldimage already exists.\n" );
- } else {
- wfOut( "Adding usertext,timestamp key on oldimage table... " );
- $wgDatabase->sourceFile( archive( "patch-oldimage-user-index.sql" ) );
- wfOut( "ok\n" );
- }
-}
-
function do_watchlist_update() {
global $wgDatabase;
$fname = 'do_watchlist_update';
wfOut( "Done.\n" );
}
-function do_user_update() {
- global $wgDatabase;
- if ( $wgDatabase->fieldExists( 'user', 'user_emailauthenticationtimestamp' ) ) {
- wfOut( "User table contains old email authentication field. Dropping... " );
- $wgDatabase->sourceFile( archive( 'patch-email-authentication.sql' ) );
- wfOut( "ok\n" );
- } else {
- wfOut( "...user table does not contain old email authentication field.\n" );
- }
-}
-
/**
* 1.4 betas were missing the 'binary' marker from logging.log_title,
* which causes a collation mismatch error on joins in MySQL 4.1.
}
}
-function do_inverse_timestamp() {
- global $wgDatabase;
- if ( $wgDatabase->fieldExists( 'revision', 'inverse_timestamp' ) ) {
- wfOut( "Removing revision.inverse_timestamp and fixing indexes... " );
- $wgDatabase->sourceFile( archive( 'patch-inverse_timestamp.sql' ) );
- wfOut( "ok\n" );
- } else {
- wfOut( "...revision timestamp indexes already up to 2005-03-13\n" );
- }
-}
-
-function do_text_id() {
- global $wgDatabase;
- if ( $wgDatabase->fieldExists( 'revision', 'rev_text_id' ) ) {
- wfOut( "...rev_text_id already in place.\n" );
- } else {
- wfOut( "Adding rev_text_id field... " );
- $wgDatabase->sourceFile( archive( 'patch-rev_text_id.sql' ) );
- wfOut( "ok\n" );
- }
-}
-
function do_pagelinks_update() {
global $wgDatabase;
if ( $wgDatabase->tableExists( 'pagelinks' ) ) {
wfOut( "ok\n" );
}
-function do_drop_img_type() {
- global $wgDatabase;
-
- if ( $wgDatabase->fieldExists( 'image', 'img_type' ) ) {
- wfOut( "Dropping unused img_type field in image table... " );
- $wgDatabase->sourceFile( archive( 'patch-drop_img_type.sql' ) );
- wfOut( "ok\n" );
- } else {
- wfOut( "...no img_type field in image table; Good.\n" );
- }
-}
-
function do_old_links_update() {
if( !defined( 'MW_NO_SETUP' ) ) {
define( 'MW_NO_SETUP', true );