}
}
- 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;
}
/**
'scripts' => 'resources/src/mediawiki.legacy/wikibits.js',
'dependencies' => 'mediawiki.util',
'position' => 'top',
+ 'targets' => array( 'desktop', 'mobile' ),
),
/* MediaWiki UI */
/**
* @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 ) {