Merge "PostgreSQL: Fix text search on moved pages"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 20 Jul 2015 23:03:58 +0000 (23:03 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 20 Jul 2015 23:03:58 +0000 (23:03 +0000)
1  2 
includes/installer/PostgresUpdater.php

@@@ -384,6 -384,8 +384,6 @@@ class PostgresUpdater extends DatabaseU
                                'page(page_id) ON DELETE CASCADE' ),
                        array( 'changeFkeyDeferrable', 'protected_titles', 'pt_user',
                                'mwuser(user_id) ON DELETE SET NULL' ),
 -                      array( 'changeFkeyDeferrable', 'recentchanges', 'rc_cur_id',
 -                              'page(page_id) ON DELETE SET NULL' ),
                        array( 'changeFkeyDeferrable', 'recentchanges', 'rc_user',
                                'mwuser(user_id) ON DELETE SET NULL' ),
                        array( 'changeFkeyDeferrable', 'redirect', 'rd_from', 'page(page_id) ON DELETE CASCADE' ),
                        array( 'addPgField', 'mwuser', 'user_password_expires', 'TIMESTAMPTZ NULL' ),
                        array( 'changeFieldPurgeTable', 'l10n_cache', 'lc_value', 'bytea',
                                "replace(lc_value,'\','\\\\')::bytea" ),
+                       // 1.23.9
+                       array( 'rebuildTextSearch'),
  
                        // 1.24
                        array( 'addPgField', 'page_props', 'pp_sortkey', 'float NULL' ),
@@@ -787,7 -791,7 +789,7 @@@ END
                        $command = "ALTER TABLE $table DROP CONSTRAINT $conname";
                        $this->db->query( $command );
                } else {
 -                      $this->output( "Foreign key constraint on '$table.$field' already does not exist\n" );
 +                      $this->output( "...foreign key constraint on '$table.$field' already does not exist\n" );
                };
        }
  
                        $this->applyPatch( 'patch-tsearch2funcs.sql', false, "Rewriting tsearch2 triggers" );
                }
        }
+       protected function rebuildTextSearch() {
+               if ( $this->updateRowExists( 'patch-textsearch_bug66650.sql' ) ) {
+                       $this->output( "...bug 66650 already fixed or not applicable.\n" );
+                       return true;
+               };
+               $this->applyPatch( 'patch-textsearch_bug66650.sql', false, "Rebuilding text search for bug 66650" );
+       }
  }