echo "...page table already exists.\n";
} else {
echo "...converting from cur/old to page/revision/text DB structure.\n"; flush();
- echo wfTimestamp();
+ echo wfTimestamp( TS_DB );
echo "......checking for duplicate entries.\n"; flush();
list ($cur, $old, $page, $revision, $text) = $wgDatabase->tableNamesN( 'cur', 'old', 'page', 'revision', 'text' );
FROM $cur GROUP BY cur_title, cur_namespace HAVING c>1", $fname );
if ( $wgDatabase->numRows( $rows ) > 0 ) {
- echo wfTimestamp();
+ echo wfTimestamp( TS_DB );
echo "......<b>Found duplicate entries</b>\n";
echo ( sprintf( "<b> %-60s %3s %5s</b>\n", 'Title', 'NS', 'Count' ) );
while ( $row = $wgDatabase->fetchObject( $rows ) ) {
}
$sql = "DELETE FROM $cur WHERE cur_id IN ( " . join( ',', $deleteId ) . ')';
$rows = $wgDatabase->query( $sql, $fname );
- echo wfTimestamp();
+ echo wfTimestamp( TS_DB );
echo "......<b>Deleted</b> ".$wgDatabase->affectedRows()." records.\n";
}
- echo wfTimestamp();
+ echo wfTimestamp( TS_DB );
echo "......Creating tables.\n";
$wgDatabase->query("CREATE TABLE $page (
page_id int(8) unsigned NOT NULL auto_increment,
INDEX usertext_timestamp (rev_user_text,rev_timestamp)
) TYPE=InnoDB", $fname );
- echo wfTimestamp();
+ echo wfTimestamp( TS_DB );
echo "......Locking tables.\n";
$wgDatabase->query( "LOCK TABLES $page WRITE, $revision WRITE, $old WRITE, $cur WRITE", $fname );
$maxold = intval( $wgDatabase->selectField( 'old', 'max(old_id)', '', $fname ) );
- echo wfTimestamp();
+ echo wfTimestamp( TS_DB );
echo "......maxold is {$maxold}\n";
- echo wfTimestamp();
+ echo wfTimestamp( TS_DB );
global $wgLegacySchemaConversion;
if( $wgLegacySchemaConversion ) {
// Create HistoryBlobCurStub entries.
SELECT cur_namespace, cur_title, $cur_text, cur_comment, cur_user, cur_user_text, cur_timestamp, cur_minor_edit, $cur_flags
FROM $cur", $fname );
- echo wfTimestamp();
+ echo wfTimestamp( TS_DB );
echo "......Setting up revision table.\n";
$wgDatabase->query( "INSERT INTO $revision (rev_id, rev_page, rev_comment, rev_user, rev_user_text, rev_timestamp,
rev_minor_edit)
old_timestamp, old_minor_edit
FROM $old,$cur WHERE old_namespace=cur_namespace AND old_title=cur_title", $fname );
- echo wfTimestamp();
+ echo wfTimestamp( TS_DB );
echo "......Setting up page table.\n";
$wgDatabase->query( "INSERT INTO $page (page_id, page_namespace, page_title, page_restrictions, page_counter,
page_is_redirect, page_is_new, page_random, page_touched, page_latest, page_len)
FROM $cur,$revision
WHERE cur_id=rev_page AND rev_timestamp=cur_timestamp AND rev_id > {$maxold}", $fname );
- echo wfTimestamp();
+ echo wfTimestamp( TS_DB );
echo "......Unlocking tables.\n";
$wgDatabase->query( "UNLOCK TABLES", $fname );
- echo wfTimestamp();
+ echo wfTimestamp( TS_DB );
echo "......Renaming old.\n";
$wgDatabase->query( "ALTER TABLE $old RENAME TO $text", $fname );
- echo wfTimestamp();
+ echo wfTimestamp( TS_DB );
echo "...done.\n";
}
}