r72841 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72840‎ | r72841 | r72842 >
Date:07:58, 12 September 2010
Author:ialex
Status:ok
Tags:
Comment:
Add `watchlist`.`wl_notificationtimestamp` through addField() instead of duplicating the code in do_watchlist_update()
Modified paths:
  • /trunk/phase3/includes/installer/MysqlUpdater.php (modified) (history)
  • /trunk/phase3/maintenance/updaters.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/updaters.inc
@@ -56,20 +56,11 @@
5757
5858 function do_watchlist_update() {
5959 $dbw = wfGetDB( DB_MASTER );
60 - if ( $dbw->fieldExists( 'watchlist', 'wl_notificationtimestamp' ) ) {
61 - wfOut( "...the watchlist table is already set up for email notification.\n" );
62 - } else {
63 - wfOut( "Adding wl_notificationtimestamp field for email notification management." );
64 - /* ALTER TABLE watchlist ADD (wl_notificationtimestamp varchar(14) binary NOT NULL default '0'); */
65 - $dbw->sourceFile( archive( 'patch-email-notification.sql' ) );
66 - wfOut( "ok\n" );
67 - }
6860 # Check if we need to add talk page rows to the watchlist
6961 $talk = $dbw->selectField( 'watchlist', 'count(*)', 'wl_namespace & 1', __METHOD__ );
7062 $nontalk = $dbw->selectField( 'watchlist', 'count(*)', 'NOT (wl_namespace & 1)', __METHOD__ );
7163 if ( $talk != $nontalk ) {
7264 wfOut( "Adding missing watchlist talk page rows... " );
73 - flush();
7465
7566 $dbw->insertSelect( 'watchlist', 'watchlist',
7667 array(
@@ -278,7 +269,6 @@
279270 wfOut( "Converting links and brokenlinks tables to pagelinks... " );
280271 $dbw->sourceFile( archive( 'patch-pagelinks.sql' ) );
281272 wfOut( "ok\n" );
282 - flush();
283273
284274 global $wgCanonicalNamespaceNames;
285275 foreach ( $wgCanonicalNamespaceNames as $ns => $name ) {
Index: trunk/phase3/includes/installer/MysqlUpdater.php
@@ -39,6 +39,7 @@
4040 array( 'addField', 'recentchanges', 'rc_patrolled', 'patch-rc-patrol.sql' ),
4141 array( 'addTable', 'logging', 'patch-logging.sql' ),
4242 array( 'addField', 'user', 'user_token', 'patch-user_token.sql' ),
 43+ array( 'addField', 'watchlist', 'wl_notificationtimestamp', 'patch-email-notification.sql' ),
4344 array( 'do_watchlist_update' ),
4445 array( 'dropField', 'user', 'user_emailauthenticationtimestamp', 'patch-email-authentication.sql' ),
4546

Status & tagging log