function do_interwiki_update() {
# Check that interwiki table exists; if it doesn't source it
- global $wgDatabase;
+ global $wgDatabase, $IP;
if( $wgDatabase->tableExists( "interwiki" ) ) {
echo "...already have interwiki table\n";
return true;
dbsource( archive("patch-interwiki.sql") );
echo "ok\n";
echo "Adding default interwiki definitions: ";
- dbsource( "maintenance/interwiki.sql" );
+ dbsource( "$IP/maintenance/interwiki.sql" );
echo "ok\n";
}
} else {
echo "Adding wl_notificationtimestamp field for email notification management.";
/* ALTER TABLE watchlist ADD (wl_notificationtimestamp varchar(14) binary NOT NULL default '0'); */
- dbsource( "maintenance/archives/patch-email-notification.sql", $wgDatabase );
+ dbsource( archive( 'patch-email-notification.sql' ), $wgDatabase );
echo "ok\n";
}
# Check if we need to add talk page rows to the watchlist
global $wgDatabase;
if( $wgDatabase->fieldExists( 'user', 'user_emailauthenticationtimestamp' ) ) {
echo "User table contains old email authentication field. Dropping... ";
- dbsource( "maintenance/archives/patch-email-authentication.sql", $wgDatabase );
+ dbsource( archive( 'patch-email-authentication.sql' ), $wgDatabase );
echo "ok\n";
} else {
echo "...user table does not contain old email authentication field.\n";
echo "Logging table has correct title encoding.\n";
} else {
echo "Fixing title encoding on logging table... ";
- dbsource( 'maintenance/archives/patch-logging-title.sql', $wgDatabase );
+ dbsource( archive( 'patch-logging-title.sql' ), $wgDatabase );
echo "ok\n";
}
}
$fname="do_schema_restructuring";
if( $wgDatabase->fieldExists( 'revision', 'inverse_timestamp' ) ) {
echo "Removing revision.inverse_timestamp and fixing indexes... ";
- dbsource( 'maintenance/archives/patch-inverse_timestamp.sql', $wgDatabase );
+ dbsource( archive( 'patch-inverse_timestamp.sql' ), $wgDatabase );
echo "ok\n";
} else {
echo "revision timestamp indexes already up to 2005-03-13\n";
echo "...rev_text_id already in place.\n";
} else {
echo "Adding rev_text_id field... ";
- dbsource( 'maintenance/archives/patch-rev_text_id.sql', $wgDatabase );
+ dbsource( archive( 'patch-rev_text_id.sql' ), $wgDatabase );
echo "ok\n";
}
}
echo "...already have pagelinks table.\n";
} else {
echo "Converting links and brokenlinks tables to pagelinks... ";
- dbsource( "maintenance/archives/patch-pagelinks.sql", $wgDatabase );
+ dbsource( archive( 'patch-pagelinks.sql' ), $wgDatabase );
echo "ok\n";
flush();
if( $wgDatabase->fieldExists( 'image', 'img_type' ) ) {
echo "Dropping unused img_type field in image table... ";
- dbsource( "maintenance/archives/patch-drop_img_type.sql", $wgDatabase );
+ dbsource( archive( 'patch-drop_img_type.sql' ), $wgDatabase );
echo "ok\n";
} else {
echo "No img_type field in image table; Good.\n";
echo "WARNING: This next step will probably fail due to unfixed duplicates...\n";
}
echo "Adding unique index on user_name... ";
- dbsource( 'maintenance/archives/patch-user_nameindex.sql', $wgDatabase );
+ dbsource( archive( 'patch-user_nameindex.sql' ), $wgDatabase );
echo "ok\n";
}
}
}
echo "Adding user_groups table... ";
- dbsource( 'maintenance/archives/patch-user_groups.sql', $wgDatabase );
+ dbsource( archive( 'patch-user_groups.sql' ), $wgDatabase );
echo "ok\n";
if( !$wgDatabase->tableExists( 'user_rights' ) ) {
if( $wgDatabase->fieldExists( 'user', 'user_rights' ) ) {
echo "Upgrading from a 1.3 or older database? Breaking out user_rights for conversion...";
- dbsource( 'maintenance/archives/patch-user_rights.sql', $wgDatabase );
+ dbsource( archive( 'patch-user_rights.sql' ), $wgDatabase );
echo "ok\n";
} else {
echo "*** WARNING: couldn't locate user_rights table or field for upgrade.\n";
echo "ok\n";
echo "Re-adding fresh user_groups table... ";
- dbsource( 'maintenance/archives/patch-user_groups.sql', $wgDatabase );
+ dbsource( archive( 'patch-user_groups.sql' ), $wgDatabase );
echo "ok\n";
echo "***\n";