r86710 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86709‎ | r86710 | r86711 >
Date:14:26, 22 April 2011
Author:freakolowsky
Status:resolved
Tags:
Comment:
* merge of r86708.
Modified paths:
  • /branches/REL1_17/phase3/includes/installer/OracleUpdater.php (modified) (history)

Diff [purge]

Index: branches/REL1_17/phase3/includes/installer/OracleUpdater.php
@@ -20,6 +20,7 @@
2121 array( 'doFKRenameDeferr' ),
2222 array( 'doFunctions17' ),
2323 array( 'doSchemaUpgrade17' ),
 24+ array( 'doInserPage0' ),
2425 );
2526 }
2627
@@ -72,7 +73,7 @@
7374 protected function doSchemaUpgrade17() {
7475 $this->output( "Updating schema to 17 ... " );
7576 // check if iwlinks table exists which was added in 1.17
76 - if ( $this->db->tableExists( trim( $this->db->tableName( 'iwlinks' ) ) ) ) {
 77+ if ( $this->db->tableExists( $this->db->tableName( 'iwlinks' ) ) ) {
7778 $this->output( "schema seem to be up to date.\n" );
7879 return;
7980 }
@@ -81,6 +82,27 @@
8283 }
8384
8485 /**
 86+ * Insert page (page_id = 0) to prevent FK constraint violation
 87+ */
 88+ protected function doInserPage0() {
 89+ $this->output( "Inserting page 0 if missing ... " );
 90+ $row = array(
 91+ 'page_id' => 0,
 92+ 'page_namespace' => 0,
 93+ 'page_title' => ' ',
 94+ 'page_counter' => 0,
 95+ 'page_is_redirect' => 0,
 96+ 'page_is_new' => 0,
 97+ 'page_random' => 0,
 98+ 'page_touched' => $this->db->timestamp(),
 99+ 'page_latest' => 0,
 100+ 'page_len' => 0
 101+ );
 102+ $this->db->insert( 'page', $row, 'OracleUpdater:doInserPage0', array( 'IGNORE' ) );
 103+ $this->output( "ok\n" );
 104+ }
 105+
 106+ /**
85107 * Overload: after this action field info table has to be rebuilt
86108 */
87109 public function doUpdates( $what = array( 'core', 'extensions', 'purge' ) ) {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r86708* insert page 0 (for FK) if updatingfreakolowsky14:23, 22 April 2011

Status & tagging log