array( 'user_newtalk', 'patch-usernewtalk2.sql' ),
array( 'transcache', 'patch-transcache.sql' ),
array( 'trackbacks', 'patch-trackbacks.sql' ),
+ array( 'externallinks', 'patch-externallinks.sql' ),
+ array( 'job', 'patch-job.sql' ),
);
$wgNewFields = array(
array( 'site_stats', 'ss_total_pages', 'patch-ss_total_articles.sql' ),
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' ),
);
function rename_table( $from, $to, $patch ) {
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 {
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() {
UNIQUE INDEX name_title (page_namespace,page_title),
INDEX (page_random),
INDEX (page_len)
- ) TYPE=InnoDB", $fname );
+ ) ENGINE=InnoDB", $fname );
$wgDatabase->query("CREATE TABLE $revision (
rev_id int(8) unsigned NOT NULL auto_increment,
rev_page int(8) unsigned NOT NULL,
INDEX page_timestamp (rev_page,rev_timestamp),
INDEX user_timestamp (rev_user,rev_timestamp),
INDEX usertext_timestamp (rev_user_text,rev_timestamp)
- ) TYPE=InnoDB", $fname );
+ ) ENGINE=InnoDB", $fname );
echo wfTimestamp();
echo "......Locking tables.\n";
echo "Done. Please run maintenance/refreshLinks.php for a more thorough templatelinks update.\n";
}
-function do_all_updates() {
- global $wgNewTables, $wgNewFields, $wgRenamedTables;
+function do_all_updates( $doShared = false ) {
+ global $wgNewTables, $wgNewFields, $wgRenamedTables, $wgSharedDB, $wgDatabase;
+
+ $doUser = !$wgSharedDB || $doShared;
# Rename tables
foreach ( $wgRenamedTables as $tableRecord ) {
# Add missing fields
foreach ( $wgNewFields as $fieldRecord ) {
- add_field( $fieldRecord[0], $fieldRecord[1], $fieldRecord[2] );
+ if ( $fieldRecord[0] != 'user' || $doUser ) {
+ add_field( $fieldRecord[0], $fieldRecord[1], $fieldRecord[2] );
+ }
flush();
}
do_old_links_update(); flush();
do_image_name_unique_update(); flush();
do_watchlist_update(); flush();
- do_user_update(); flush();
+ if ( $doUser ) {
+ do_user_update(); flush();
+ }
###### do_copy_newtalk_to_watchlist(); flush();
do_logging_encoding(); flush();
do_drop_img_type(); flush();
- do_user_unique_update(); flush();
+ if ( $doUser ) {
+ do_user_unique_update(); flush();
+ }
do_user_groups_update(); flush();
do_watchlist_null(); flush();