summaryrefslogtreecommitdiff
path: root/includes/installer/SqliteUpdater.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2011-06-22 11:28:20 +0200
committerPierre Schmitz <pierre@archlinux.de>2011-06-22 11:28:20 +0200
commit9db190c7e736ec8d063187d4241b59feaf7dc2d1 (patch)
tree46d1a0dee7febef5c2d57a9f7b972be16a163b3d /includes/installer/SqliteUpdater.php
parent78677c7bbdcc9739f6c10c75935898a20e1acd9e (diff)
update to MediaWiki 1.17.0
Diffstat (limited to 'includes/installer/SqliteUpdater.php')
-rw-r--r--includes/installer/SqliteUpdater.php84
1 files changed, 84 insertions, 0 deletions
diff --git a/includes/installer/SqliteUpdater.php b/includes/installer/SqliteUpdater.php
new file mode 100644
index 00000000..d1a6c20b
--- /dev/null
+++ b/includes/installer/SqliteUpdater.php
@@ -0,0 +1,84 @@
+<?php
+/**
+ * Sqlite-specific updater.
+ *
+ * @file
+ * @ingroup Deployment
+ */
+
+/**
+ * Class for handling updates to Sqlite databases.
+ *
+ * @ingroup Deployment
+ * @since 1.17
+ */
+class SqliteUpdater extends DatabaseUpdater {
+
+ protected function getCoreUpdateList() {
+ return array(
+ // 1.14
+ array( 'addField', 'site_stats', 'ss_active_users', 'patch-ss_active_users.sql' ),
+ array( 'doActiveUsersInit' ),
+ array( 'addField', 'ipblocks', 'ipb_allow_usertalk', 'patch-ipb_allow_usertalk.sql' ),
+ array( 'sqliteInitialIndexes' ),
+
+ // 1.15
+ array( 'addTable', 'change_tag', 'patch-change_tag.sql' ),
+ array( 'addTable', 'tag_summary', 'patch-change_tag.sql' ),
+ array( 'addTable', 'valid_tag', 'patch-change_tag.sql' ),
+
+ // 1.16
+ array( 'addTable', 'user_properties', 'patch-user_properties.sql' ),
+ array( 'addTable', 'log_search', 'patch-log_search.sql' ),
+ array( 'addField', 'logging', 'log_user_text', 'patch-log_user_text.sql' ),
+ array( 'doLogUsertextPopulation' ), # listed separately from the previous update because 1.16 was released without this update
+ array( 'doLogSearchPopulation' ),
+ array( 'addTable', 'l10n_cache', 'patch-l10n_cache.sql' ),
+ array( 'addTable', 'external_user', 'patch-external_user.sql' ),
+ array( 'addIndex', 'log_search', 'ls_field_val', 'patch-log_search-rename-index.sql' ),
+ array( 'addIndex', 'change_tag', 'change_tag_rc_tag', 'patch-change_tag-indexes.sql' ),
+ array( 'addField', 'redirect', 'rd_interwiki', 'patch-rd_interwiki.sql' ),
+ array( 'doUpdateTranscacheField' ),
+ array( 'sqliteSetupSearchindex' ),
+
+ // 1.17
+ array( 'addTable', 'iwlinks', 'patch-iwlinks.sql' ),
+ array( 'addIndex', 'iwlinks', 'iwl_prefix_title_from', 'patch-rename-iwl_prefix.sql' ),
+ array( 'addField', 'updatelog', 'ul_value', 'patch-ul_value.sql' ),
+ array( 'addField', 'interwiki', 'iw_api', 'patch-iw_api_and_wikiid.sql' ),
+ array( 'dropIndex', 'iwlinks', 'iwl_prefix', 'patch-kill-iwl_prefix.sql' ),
+ array( 'dropIndex', 'iwlinks', 'iwl_prefix_from_title', 'patch-kill-iwl_pft.sql' ),
+ array( 'addField', 'categorylinks', 'cl_collation', 'patch-categorylinks-better-collation.sql' ),
+ array( 'doCollationUpdate' ),
+ array( 'addTable', 'msg_resource', 'patch-msg_resource.sql' ),
+ array( 'addTable', 'module_deps', 'patch-module_deps.sql' ),
+ );
+ }
+
+ protected function sqliteInitialIndexes() {
+ // initial-indexes.sql fails if the indexes are already present, so we perform a quick check if our database is newer.
+ if ( $this->updateRowExists( 'initial_indexes' ) || $this->db->indexExists( 'user', 'user_name' ) ) {
+ $this->output( "...have initial indexes\n" );
+ return;
+ }
+ $this->output( "Adding initial indexes..." );
+ $this->applyPatch( 'initial-indexes.sql' );
+ $this->output( "done\n" );
+ }
+
+ protected function sqliteSetupSearchindex() {
+ $module = DatabaseSqlite::getFulltextSearchModule();
+ $fts3tTable = $this->updateRowExists( 'fts3' );
+ if ( $fts3tTable && !$module ) {
+ $this->output( '...PHP is missing FTS3 support, downgrading tables...' );
+ $this->applyPatch( 'searchindex-no-fts.sql' );
+ $this->output( "done\n" );
+ } elseif ( !$fts3tTable && $module == 'FTS3' ) {
+ $this->output( '...adding FTS3 search capabilities...' );
+ $this->applyPatch( 'searchindex-fts3.sql' );
+ $this->output( "done\n" );
+ } else {
+ $this->output( "...fulltext search table appears to be in order.\n" );
+ }
+ }
+}