bug 10280: For table categorylinks, add cl_from to the cl_sortkey index
[lhc/web/wiklou.git] / maintenance / updaters.inc
index c2a69c9..6603861 100644 (file)
@@ -837,6 +837,14 @@ function do_backlinking_indices_update() {
        }
 }
 
+function do_categorylinks_indices_update() {
+       echo( "Checking for categorylinks indices...\n" );
+       if (!index_has_field('categorylinks', 'cl_sortkey', 'cl_from'))
+       {       
+               dbsource( archive( 'patch-categorylinksindex.sql' ) );
+       }
+}
+
 function do_stats_init() {
        // Sometimes site_stats table is not properly populated.
        global $wgDatabase;
@@ -932,6 +940,8 @@ function do_all_updates( $shared = false, $purge = true ) {
 
        do_backlinking_indices_update(); flush();
 
+       do_categorylinks_indices_update(); flush();
+
        do_restrictions_update(); flush ();
 
        echo "Deleting old default messages (this may take a long time!)..."; flush();