Merge "Use LinkTarget in EmailNotification::updateWatchlistTimestamp"
[lhc/web/wiklou.git] / maintenance / updateCollation.php
index bb75314..37c9948 100644 (file)
@@ -42,12 +42,13 @@ class UpdateCollation extends Maintenance {
                parent::__construct();
 
                global $wgCategoryCollation;
-               $this->mDescription = <<<TEXT
+               $this->addDescription( <<<TEXT
 This script will find all rows in the categorylinks table whose collation is
 out-of-date (cl_collation != '$wgCategoryCollation') and repopulate cl_sortkey
 using the page title and cl_sortkey_prefix.  If all collations are
 up-to-date, it will do nothing.
-TEXT;
+TEXT
+               );
 
                $this->addOption( 'force', 'Run on all rows, even if the collation is ' .
                        'supposed to be up-to-date.' );
@@ -86,7 +87,7 @@ TEXT;
 
                $options = array(
                        'LIMIT' => self::BATCH_SIZE,
-                       'ORDER BY' => 'cl_to, cl_type, cl_from',
+                       'ORDER BY' => 'cl_from, cl_to',
                        'STRAIGHT_JOIN',
                );
 
@@ -132,7 +133,7 @@ TEXT;
                        $res = $dbw->select(
                                array( 'categorylinks', 'page' ),
                                array( 'cl_from', 'cl_to', 'cl_sortkey_prefix', 'cl_collation',
-                                       'cl_sortkey', 'cl_type', 'page_namespace', 'page_title'
+                                       'cl_sortkey', 'page_namespace', 'page_title'
                                ),
                                array_merge( $collationConds, $batchConds, array( 'cl_from = page_id' ) ),
                                __METHOD__,
@@ -216,13 +217,13 @@ TEXT;
 
        /**
         * Return an SQL expression selecting rows which sort above the given row,
-        * assuming an ordering of cl_to, cl_type, cl_from
+        * assuming an ordering of cl_from, cl_to
         * @param stdClass $row
         * @param DatabaseBase $dbw
         * @return string
         */
        function getBatchCondition( $row, $dbw ) {
-               $fields = array( 'cl_to', 'cl_type', 'cl_from' );
+               $fields = array( 'cl_from', 'cl_to' );
                $first = true;
                $cond = false;
                $prefix = false;