summaryrefslogtreecommitdiff
path: root/maintenance/sqlite
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2010-07-28 11:52:48 +0200
committerPierre Schmitz <pierre@archlinux.de>2010-07-28 11:52:48 +0200
commit222b01f5169f1c7e69762e0e8904c24f78f71882 (patch)
tree8e932e12546bb991357ec48eb1638d1770be7a35 /maintenance/sqlite
parent00ab76a6b686e98a914afc1975812d2b1aaa7016 (diff)
update to MediaWiki 1.16.0
Diffstat (limited to 'maintenance/sqlite')
-rw-r--r--maintenance/sqlite/archives/initial-indexes.sql39
-rw-r--r--maintenance/sqlite/archives/patch-log_user_text.sql5
-rw-r--r--maintenance/sqlite/archives/patch-rd_interwiki.sql5
-rw-r--r--maintenance/sqlite/archives/patch-tc-timestamp.sql3
-rw-r--r--maintenance/sqlite/archives/searchindex-fts3.sql18
-rw-r--r--maintenance/sqlite/archives/searchindex-no-fts.sql25
6 files changed, 75 insertions, 20 deletions
diff --git a/maintenance/sqlite/archives/initial-indexes.sql b/maintenance/sqlite/archives/initial-indexes.sql
index a88b7a26..f0851163 100644
--- a/maintenance/sqlite/archives/initial-indexes.sql
+++ b/maintenance/sqlite/archives/initial-indexes.sql
@@ -4,8 +4,7 @@
-- the CREATE INDEX statement will fail if there are duplicate values.
--
-- Ignore duplicates, several tables will have them (e.g. bug 16966) but in
--- most cases it's harmless to discard them. We'll keep the old tables with
--- duplicates in so that the user can recover them in case of disaster.
+-- most cases it's harmless to discard them.
--------------------------------------------------------------------------------
-- Drop temporary tables from aborted runs
@@ -296,41 +295,41 @@ INSERT OR IGNORE INTO /*_*/page_props_tmp SELECT * FROM /*_*/page_props;
-- Do the table renames
--------------------------------------------------------------------------------
-ALTER TABLE /*_*/user RENAME TO /*_*/user_old_13;
+DROP TABLE /*_*/user;
ALTER TABLE /*_*/user_tmp RENAME TO /*_*/user;
-ALTER TABLE /*_*/user_groups RENAME TO /*_*/user_groups_old_13;
+DROP TABLE /*_*/user_groups;
ALTER TABLE /*_*/user_groups_tmp RENAME TO /*_*/user_groups;
-ALTER TABLE /*_*/page RENAME TO /*_*/page_old_13;
+DROP TABLE /*_*/page;
ALTER TABLE /*_*/page_tmp RENAME TO /*_*/page;
-ALTER TABLE /*_*/revision RENAME TO /*_*/revision_old_13;
+DROP TABLE /*_*/revision;
ALTER TABLE /*_*/revision_tmp RENAME TO /*_*/revision;
-ALTER TABLE /*_*/pagelinks RENAME TO /*_*/pagelinks_old_13;
+DROP TABLE /*_*/pagelinks;
ALTER TABLE /*_*/pagelinks_tmp RENAME TO /*_*/pagelinks;
-ALTER TABLE /*_*/templatelinks RENAME TO /*_*/templatelinks_old_13;
+DROP TABLE /*_*/templatelinks;
ALTER TABLE /*_*/templatelinks_tmp RENAME TO /*_*/templatelinks;
-ALTER TABLE /*_*/imagelinks RENAME TO /*_*/imagelinks_old_13;
+DROP TABLE /*_*/imagelinks;
ALTER TABLE /*_*/imagelinks_tmp RENAME TO /*_*/imagelinks;
-ALTER TABLE /*_*/categorylinks RENAME TO /*_*/categorylinks_old_13;
+DROP TABLE /*_*/categorylinks;
ALTER TABLE /*_*/categorylinks_tmp RENAME TO /*_*/categorylinks;
-ALTER TABLE /*_*/category RENAME TO /*_*/category_old_13;
+DROP TABLE /*_*/category;
ALTER TABLE /*_*/category_tmp RENAME TO /*_*/category;
-ALTER TABLE /*_*/langlinks RENAME TO /*_*/langlinks_old_13;
+DROP TABLE /*_*/langlinks;
ALTER TABLE /*_*/langlinks_tmp RENAME TO /*_*/langlinks;
-ALTER TABLE /*_*/site_stats RENAME TO /*_*/site_stats_old_13;
+DROP TABLE /*_*/site_stats;
ALTER TABLE /*_*/site_stats_tmp RENAME TO /*_*/site_stats;
-ALTER TABLE /*_*/ipblocks RENAME TO /*_*/ipblocks_old_13;
+DROP TABLE /*_*/ipblocks;
ALTER TABLE /*_*/ipblocks_tmp RENAME TO /*_*/ipblocks;
-ALTER TABLE /*_*/watchlist RENAME TO /*_*/watchlist_old_13;
+DROP TABLE /*_*/watchlist;
ALTER TABLE /*_*/watchlist_tmp RENAME TO /*_*/watchlist;
-ALTER TABLE /*_*/math RENAME TO /*_*/math_old_13;
+DROP TABLE /*_*/math;
ALTER TABLE /*_*/math_tmp RENAME TO /*_*/math;
-ALTER TABLE /*_*/interwiki RENAME TO /*_*/interwiki_old_13;
+DROP TABLE /*_*/interwiki;
ALTER TABLE /*_*/interwiki_tmp RENAME TO /*_*/interwiki;
-ALTER TABLE /*_*/page_restrictions RENAME TO /*_*/page_restrictions_old_13;
+DROP TABLE /*_*/page_restrictions;
ALTER TABLE /*_*/page_restrictions_tmp RENAME TO /*_*/page_restrictions;
-ALTER TABLE /*_*/protected_titles RENAME TO /*_*/protected_titles_old_13;
+DROP TABLE /*_*/protected_titles;
ALTER TABLE /*_*/protected_titles_tmp RENAME TO /*_*/protected_titles;
-ALTER TABLE /*_*/page_props RENAME TO /*_*/page_props_old_13;
+DROP TABLE /*_*/page_props;
ALTER TABLE /*_*/page_props_tmp RENAME TO /*_*/page_props;
--------------------------------------------------------------------------------
diff --git a/maintenance/sqlite/archives/patch-log_user_text.sql b/maintenance/sqlite/archives/patch-log_user_text.sql
new file mode 100644
index 00000000..c7fcc75f
--- /dev/null
+++ b/maintenance/sqlite/archives/patch-log_user_text.sql
@@ -0,0 +1,5 @@
+ALTER TABLE /*$wgDBprefix*/logging ADD COLUMN log_user_text TEXT NOT NULL default '';
+ALTER TABLE /*$wgDBprefix*/logging ADD COLUMN log_page INTEGER NULL;
+
+CREATE INDEX /*i*/log_user_type_time ON /*_*/logging (log_user, log_type, log_timestamp);
+CREATE INDEX /*i*/log_page_id_time ON /*_*/logging (log_page,log_timestamp);
diff --git a/maintenance/sqlite/archives/patch-rd_interwiki.sql b/maintenance/sqlite/archives/patch-rd_interwiki.sql
new file mode 100644
index 00000000..ae4870a4
--- /dev/null
+++ b/maintenance/sqlite/archives/patch-rd_interwiki.sql
@@ -0,0 +1,5 @@
+-- Add interwiki and fragment columns to redirect table
+
+ALTER TABLE /*$wgDBprefix*/redirect ADD COLUMN rd_interwiki TEXT default NULL;
+ALTER TABLE /*$wgDBprefix*/redirect ADD COLUMN rd_fragment TEXT default NULL;
+
diff --git a/maintenance/sqlite/archives/patch-tc-timestamp.sql b/maintenance/sqlite/archives/patch-tc-timestamp.sql
new file mode 100644
index 00000000..551a5f1c
--- /dev/null
+++ b/maintenance/sqlite/archives/patch-tc-timestamp.sql
@@ -0,0 +1,3 @@
+UPDATE /*_*/transcache SET tc_time = strftime('%Y%m%d%H%M%S', datetime(tc_time, 'unixepoch'));
+
+INSERT INTO /*_*/updatelog VALUES ('convert transcache field');
diff --git a/maintenance/sqlite/archives/searchindex-fts3.sql b/maintenance/sqlite/archives/searchindex-fts3.sql
new file mode 100644
index 00000000..c3a86894
--- /dev/null
+++ b/maintenance/sqlite/archives/searchindex-fts3.sql
@@ -0,0 +1,18 @@
+-- Patch that introduces fulltext search capabilities to SQLite schema
+-- Requires that SQLite must be compiled with FTS3 module (comes with core amalgamation).
+-- See http://sqlite.org/fts3.html for details of syntax.
+-- Will fail if FTS3 is not present,
+DROP TABLE IF EXISTS /*_*/searchindex;
+CREATE VIRTUAL TABLE /*_*/searchindex USING FTS3(
+ -- Key to page_id
+ -- Disabled, instead we use the built-in rowid column
+ -- si_page INTEGER NOT NULL,
+
+ -- Munged version of title
+ si_title,
+
+ -- Munged version of body text
+ si_text
+);
+
+INSERT INTO /*_*/updatelog VALUES ('fts3'); \ No newline at end of file
diff --git a/maintenance/sqlite/archives/searchindex-no-fts.sql b/maintenance/sqlite/archives/searchindex-no-fts.sql
new file mode 100644
index 00000000..bc014b3d
--- /dev/null
+++ b/maintenance/sqlite/archives/searchindex-no-fts.sql
@@ -0,0 +1,25 @@
+-- Searchindex table definition for cases when no full-text search SQLite module is present
+-- (currently, only FTS3 is supported).
+-- Use it if you are moving your database from environment with FTS support
+-- to environment without it.
+
+DROP TABLE IF EXISTS /*_*/searchindex;
+
+-- These are pieces of FTS3-enabled searchindex
+DROP TABLE IF EXISTS /*_*/searchindex_content;
+DROP TABLE IF EXISTS /*_*/searchindex_segdir;
+DROP TABLE IF EXISTS /*_*/searchindex_segments;
+
+CREATE TABLE /*_*/searchindex (
+ -- Key to page_id
+ -- Disabled, instead we use the built-in rowid column
+ -- si_page INTEGER NOT NULL,
+
+ -- Munged version of title
+ si_title TEXT,
+
+ -- Munged version of body text
+ si_text TEXT
+);
+
+DELETE FROM /*_*/updatelog WHERE ul_key='fts3'; \ No newline at end of file