From 47e1ca87f8cf6c0971833ef0ad3f730c3eccca0c Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Wed, 22 Feb 2006 00:45:27 +0000 Subject: [PATCH] watchlist row duplication --- maintenance/updaters.inc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/maintenance/updaters.inc b/maintenance/updaters.inc index d53b429cec..ab08e271b1 100644 --- a/maintenance/updaters.inc +++ b/maintenance/updaters.inc @@ -199,6 +199,7 @@ function do_logging_timestamp_index() { function do_watchlist_update() { global $wgDatabase; + $fname = 'do_watchlist_update'; if( $wgDatabase->fieldExists( 'watchlist', 'wl_notificationtimestamp' ) ) { echo "The watchlist table is already set up for email notification.\n"; } else { @@ -207,6 +208,24 @@ function do_watchlist_update() { dbsource( "maintenance/archives/patch-email-notification.sql", $wgDatabase ); echo "ok\n"; } + # Check if we need to add talk page rows to the watchlist + $talk = $wgDatabase->selectField( 'watchlist', 'count(*)', 'wl_namespace & 1', $fname ); + $nontalk = $wgDatabase->selectField( 'watchlist', 'count(*)', 'NOT (wl_namespace & 1)', $fname ); + if ( $talk != $nontalk ) { + echo "Adding missing watchlist talk page rows... "; + flush(); + + $wgDatabase->insertSelect( 'watchlist', 'watchlist', + array( + 'wl_user' => 'wl_user', + 'wl_namespace' => 'wl_namespace | 1', + 'wl_title' => 'wl_title', + 'wl_notificationtimestamp' => 'wl_notificationtimestamp' + ), array( 'NOT (wl_namespace & 1)' ), $fname, 'IGNORE' ); + echo "ok\n"; + } else { + echo "...watchlist talk page rows already present\n"; + } } function do_copy_newtalk_to_watchlist() { -- 2.20.1