Index: branches/REL1_17/phase3/includes/installer/OracleUpdater.php |
— | — | @@ -20,6 +20,7 @@ |
21 | 21 | array( 'doFKRenameDeferr' ), |
22 | 22 | array( 'doFunctions17' ), |
23 | 23 | array( 'doSchemaUpgrade17' ), |
| 24 | + array( 'doInserPage0' ), |
24 | 25 | ); |
25 | 26 | } |
26 | 27 | |
— | — | @@ -72,7 +73,7 @@ |
73 | 74 | protected function doSchemaUpgrade17() { |
74 | 75 | $this->output( "Updating schema to 17 ... " ); |
75 | 76 | // 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' ) ) ) { |
77 | 78 | $this->output( "schema seem to be up to date.\n" ); |
78 | 79 | return; |
79 | 80 | } |
— | — | @@ -81,6 +82,27 @@ |
82 | 83 | } |
83 | 84 | |
84 | 85 | /** |
| 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 | + /** |
85 | 107 | * Overload: after this action field info table has to be rebuilt |
86 | 108 | */ |
87 | 109 | public function doUpdates( $what = array( 'core', 'extensions', 'purge' ) ) { |