From d81f562b712f2387fa02290bf2ca86392ab356f2 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 11 Oct 2006 20:21:25 +0000 Subject: Aktualisierung auf Version 1.8.1 --- maintenance/updaters.inc | 144 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 143 insertions(+), 1 deletion(-) (limited to 'maintenance/updaters.inc') diff --git a/maintenance/updaters.inc b/maintenance/updaters.inc index 164a00cf..d334660e 100644 --- a/maintenance/updaters.inc +++ b/maintenance/updaters.inc @@ -56,6 +56,7 @@ $wgNewFields = array( array( 'interwiki', 'iw_trans', 'patch-interwiki-trans.sql' ), array( 'ipblocks', 'ipb_range_start', 'patch-ipb_range_start.sql' ), array( 'site_stats', 'ss_images', 'patch-ss_images.sql' ), + array( 'ipblocks', 'ipb_anon_only', 'patch-ipb_anon_only.sql' ), ); function rename_table( $from, $to, $patch ) { @@ -761,11 +762,33 @@ function do_templatelinks_update() { echo "Done. Please run maintenance/refreshLinks.php for a more thorough templatelinks update.\n"; } +# July 2006 +# Add ( rc_namespace, rc_user_text ) index [R. Church] +function do_rc_indices_update() { + global $wgDatabase; + echo( "Checking for additional recent changes indices...\n" ); + # See if we can find the index we want + $info = $wgDatabase->indexInfo( 'recentchanges', 'rc_ns_usertext', __METHOD__ ); + if( !$info ) { + # None, so create + echo( "...index on ( rc_namespace, rc_user_text ) not found; creating\n" ); + dbsource( archive( 'patch-recentchanges-utindex.sql' ) ); + } else { + # Index seems to exist + echo( "...seems to be ok\n" ); + } +} + function do_all_updates( $doShared = false ) { - global $wgNewTables, $wgNewFields, $wgRenamedTables, $wgSharedDB, $wgDatabase; + global $wgNewTables, $wgNewFields, $wgRenamedTables, $wgSharedDB, $wgDatabase, $wgDBtype; $doUser = !$wgSharedDB || $doShared; + if ($wgDBtype === 'postgres') { + do_postgres_updates(); + return; + } + # Rename tables foreach ( $wgRenamedTables as $tableRecord ) { rename_table( $tableRecord[0], $tableRecord[1], $tableRecord[2] ); @@ -819,6 +842,8 @@ function do_all_updates( $doShared = false ) { do_logging_timestamp_index(); flush(); do_page_random_update(); flush(); + + do_rc_indices_update(); flush(); initialiseMessages(); flush(); } @@ -832,4 +857,121 @@ function archive($name) { return "$IP/maintenance/archives/$name"; } } + +function do_postgres_updates() { + global $wgDatabase, $wgVersion, $wgDBmwschema; + + $version = "1.7.1"; + + # Just in case their LocalSetings.php does not have this: + if ( !isset( $wgDBmwschema )) + $wgDBmwschema = 'mediawiki'; + + if ($wgDatabase->tableExists("mediawiki_version")) { + $version = "1.8"; + } + + if ($version == '1.7.1') { + $upgrade = <<query($upgrade); + + } ## end version 1.7.1 upgrade + + else { + print "No updates needed\n"; + } + + return; +} + ?> -- cgit v1.2.3-54-g00ecf