From 4d488c839683b2457d0756300a26d31c53b85678 Mon Sep 17 00:00:00 2001 From: Jerome Jamnicky Date: Mon, 24 May 2004 01:03:30 +0000 Subject: [PATCH] Remove lcc_title field from linkscc table, if necessary, upon 1.3 install/upgrade. --- config/index.php | 1 + maintenance/update2.php | 1 + maintenance/updaters.inc | 13 +++++++++++++ update.php | 1 + 4 files changed, 16 insertions(+) diff --git a/config/index.php b/config/index.php index ad1cc16358..b46428795b 100644 --- a/config/index.php +++ b/config/index.php @@ -400,6 +400,7 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) { do_interwiki_update(); flush(); do_index_update(); flush(); do_linkscc_update(); flush(); + do_linkscc_1_3_update(); flush(); do_hitcounter_update(); flush(); do_recentchanges_update(); flush(); convertLinks(); flush(); diff --git a/maintenance/update2.php b/maintenance/update2.php index afd07e0a91..7d4a19929c 100644 --- a/maintenance/update2.php +++ b/maintenance/update2.php @@ -12,6 +12,7 @@ do_ipblocks_update(); flush(); do_interwiki_update(); flush(); do_index_update(); flush(); do_linkscc_update(); flush(); +do_linkscc_1_3_update(); flush(); do_hitcounter_update(); flush(); do_recentchanges_update(); flush(); do_user_real_name_update(); flush(); diff --git a/maintenance/updaters.inc b/maintenance/updaters.inc index d557ebb5e8..9f5b4a2bc9 100644 --- a/maintenance/updaters.inc +++ b/maintenance/updaters.inc @@ -102,6 +102,19 @@ function do_linkscc_update() { } } +function do_linkscc_1_3_update() { + // Update linkscc table to 1.3 schema if necessary + global $wgDatabase, $wgVersion; + if( ( strpos( "1.3", $wgVersion ) === 0 ) && $wgDatabase->tableExists( "linkscc" ) + && $wgDatabase->fieldExists( "linkscc", "lcc_title" ) ) { + echo "Altering lcc_title field from linkscc table... "; + dbsource( "maintenance/archives/patch-linkscc-1.3.sql", $wgDatabase ); + echo "ok\n"; + } else { + echo "...linkscc is up to date, or does not exist. Good.\n"; + } +} + function do_hitcounter_update() { // Create hitcounter if necessary global $wgDatabase; diff --git a/update.php b/update.php index 150e01b47d..94dba69b76 100644 --- a/update.php +++ b/update.php @@ -63,6 +63,7 @@ do_ipblocks_update(); do_interwiki_update(); do_index_update(); do_linkscc_update(); +do_linkscc_1_3_update(); do_hitcounter_update(); do_recentchanges_update(); do_user_real_name_update(); -- 2.20.1