Merge "Simplify and unify the {{REVISIONID}} handling code in Parser"
[lhc/web/wiklou.git] / includes / installer / PostgresUpdater.php
index 75877a1..008240a 100644 (file)
@@ -839,7 +839,7 @@ END;
                if ( !$this->db->tableExists( $table, __METHOD__ ) ) {
                        $this->output( "...skipping: '$table' table doesn't exist yet.\n" );
 
-                       return;
+                       return true;
                }
 
                // Second requirement: the new index must be missing
@@ -853,17 +853,18 @@ END;
                                        "            $old should be manually removed if not needed anymore.\n" );
                        }
 
-                       return;
+                       return true;
                }
 
                // Third requirement: the old index must exist
                if ( !$this->db->indexExists( $table, $old, __METHOD__ ) ) {
                        $this->output( "...skipping: index $old doesn't exist.\n" );
 
-                       return;
+                       return true;
                }
 
                $this->db->query( "ALTER INDEX $old RENAME TO $new" );
+               return true;
        }
 
        protected function dropPgField( $table, $field ) {
@@ -1007,13 +1008,11 @@ END;
        public function addPgExtIndex( $table, $index, $type ) {
                if ( $this->db->indexExists( $table, $index ) ) {
                        $this->output( "...index '$index' on table '$table' already exists\n" );
+               } elseif ( preg_match( '/^\(/', $type ) ) {
+                       $this->output( "Creating index '$index' on table '$table'\n" );
+                       $this->db->query( "CREATE INDEX $index ON $table $type" );
                } else {
-                       if ( preg_match( '/^\(/', $type ) ) {
-                               $this->output( "Creating index '$index' on table '$table'\n" );
-                               $this->db->query( "CREATE INDEX $index ON $table $type" );
-                       } else {
-                               $this->applyPatch( $type, true, "Creating index '$index' on table '$table'" );
-                       }
+                       $this->applyPatch( $type, true, "Creating index '$index' on table '$table'" );
                }
        }