r23491 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23490‎ | r23491 | r23492 >
Date:20:43, 27 June 2007
Author:aaron
Status:old
Tags:
Comment:
*Add usertext_timestamp index to archive table
Modified paths:
  • /trunk/phase3/maintenance/archives/patch-archive-user-index.sql (added) (history)
  • /trunk/phase3/maintenance/updaters.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/archives/patch-archive-user-index.sql
@@ -0,0 +1,4 @@
 2+-- Adds a user,timestamp index to the archive table
 3+-- Used for browsing deleted contributions and renames
 4+ALTER TABLE /*$wgDBprefix*/archive
 5+ ADD INDEX usertext_timestamp ( ar_user_text , ar_timestamp )
Index: trunk/phase3/maintenance/updaters.inc
@@ -76,8 +76,8 @@
7777 array( 'archive', 'ar_len', 'patch-ar_len.sql' ),
7878 array( 'revision', 'rev_parent_id', 'patch-rev_parent_id.sql' ),
7979 array( 'page_restrictions', 'pr_id', 'patch-page_restrictions_sortkey.sql' ),
80 - array( 'ipblocks', 'ipb_block_email', 'patch-ipb_emailban.sql' ),
81 - array( 'oldimage', 'oi_metadata', 'patch-oi_metadata.sql'),
 80+ array( 'ipblocks', 'ipb_block_email', 'patch-ipb_emailban.sql' ),
 81+ array( 'oldimage', 'oi_metadata', 'patch-oi_metadata.sql'),
8282 );
8383
8484 function rename_table( $from, $to, $patch ) {
@@ -221,6 +221,16 @@
222222 }
223223 }
224224
 225+function do_archive_user_index() {
 226+ global $wgDatabase;
 227+ if( $wgDatabase->indexExists( 'archive', 'usertext_timestamp' ) ) {
 228+ echo "...usertext,timestamp key on archive already exists.\n";
 229+ } else {
 230+ echo "Adding usertext,timestamp key on archive table... ";
 231+ dbsource( archive("patch-archive-user-index.sql"), $wgDatabase );
 232+ echo "ok\n";
 233+ }
 234+}
225235
226236 function do_watchlist_update() {
227237 global $wgDatabase;
@@ -944,6 +954,8 @@
945955 do_categorylinks_indices_update(); flush();
946956
947957 do_restrictions_update(); flush ();
 958+
 959+ do_archive_user_index(); flush ();
948960
949961 echo "Deleting old default messages (this may take a long time!)..."; flush();
950962 deleteDefaultMessages();
@@ -1275,7 +1287,8 @@
12761288 );
12771289
12781290 $newindexes = array(
1279 - array("revision", "rev_text_id_idx", "patch-rev_text_id_idx.sql")
 1291+ array("revision", "rev_text_id_idx", "patch-rev_text_id_idx.sql"),
 1292+ array("archive", "usertext_timestamp", "patch-archive-user-index.sql"),
12801293 );
12811294
12821295 $newrules = array(

Follow-up revisions

RevisionCommit summaryAuthorDate
r23581Merged revisions 23406-23580 via svnmerge from...david04:50, 30 June 2007

Status & tagging log