Merge "Status: Correct documentation"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 6 Aug 2015 17:05:52 +0000 (17:05 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 6 Aug 2015 17:05:52 +0000 (17:05 +0000)
includes/db/DatabaseSqlite.php
resources/Resources.php
resources/src/mediawiki/mediawiki.notify.js

index 2bad711..9c93951 100644 (file)
@@ -964,7 +964,36 @@ class DatabaseSqlite extends DatabaseBase {
                        }
                }
 
-               return $this->query( $sql, $fname );
+               $res = $this->query( $sql, $fname );
+
+               // Take over indexes
+               $indexList = $this->query( 'PRAGMA INDEX_LIST(' . $this->addQuotes( $oldName ) . ')' );
+               foreach ( $indexList as $index ) {
+                       if ( strpos( $index->name, 'sqlite_autoindex' ) === 0 ) {
+                               continue;
+                       }
+
+                       if ( $index->unique ) {
+                               $sql = 'CREATE UNIQUE INDEX';
+                       } else {
+                               $sql = 'CREATE INDEX';
+                       }
+                       // Try to come up with a new index name, given indexes have database scope in SQLite
+                       $indexName = $newName . '_' . $index->name;
+                       $sql .= ' ' . $indexName . ' ON ' . $newName;
+
+                       $indexInfo = $this->query( 'PRAGMA INDEX_INFO(' . $this->addQuotes( $index->name ) . ')' );
+                       $fields = array();
+                       foreach ( $indexInfo as $indexInfoRow ) {
+                               $fields[ $indexInfoRow->seqno ] = $indexInfoRow->name;
+                       }
+
+                       $sql .= '(' . implode( ',', $fields ) . ')';
+
+                       $this->query( $sql );
+               }
+
+               return $res;
        }
 
        /**
index 060ed5b..2396128 100644 (file)
@@ -1697,6 +1697,7 @@ return array(
                'scripts' => 'resources/src/mediawiki.legacy/wikibits.js',
                'dependencies' => 'mediawiki.util',
                'position' => 'top',
+               'targets' => array( 'desktop', 'mobile' ),
        ),
 
        /* MediaWiki UI */
index c1e1dab..0f3a086 100644 (file)
@@ -6,8 +6,9 @@
 
        /**
         * @see mw.notification#notify
-        * @param message
-        * @param options
+        * @see mw.notification#defaults
+        * @param {HTMLElement|HTMLElement[]|jQuery|mw.Message|string} message
+        * @param {Object} options See mw.notification#defaults for details.
         * @return {jQuery.Promise}
         */
        mw.notify = function ( message, options ) {