diff options
Diffstat (limited to 'maintenance/sqlite/archives')
-rw-r--r-- | maintenance/sqlite/archives/patch-drop-ss_admins.sql | 22 | ||||
-rw-r--r-- | maintenance/sqlite/archives/patch-job_token.sql | 8 | ||||
-rw-r--r-- | maintenance/sqlite/archives/patch-profiling.sql | 12 | ||||
-rw-r--r-- | maintenance/sqlite/archives/patch-rc_moved.sql | 46 | ||||
-rw-r--r-- | maintenance/sqlite/archives/patch-rename-iwl_prefix.sql | 2 | ||||
-rw-r--r-- | maintenance/sqlite/archives/patch-sites.sql | 71 | ||||
-rw-r--r-- | maintenance/sqlite/archives/patch-ufg_group-length-increase-255.sql (renamed from maintenance/sqlite/archives/patch-ufg_group-length-increase.sql) | 10 | ||||
-rw-r--r-- | maintenance/sqlite/archives/patch-ug_group-length-increase-255.sql (renamed from maintenance/sqlite/archives/patch-ug_group-length-increase.sql) | 2 | ||||
-rw-r--r-- | maintenance/sqlite/archives/searchindex-fts3.sql | 4 | ||||
-rw-r--r-- | maintenance/sqlite/archives/searchindex-no-fts.sql | 2 |
10 files changed, 169 insertions, 10 deletions
diff --git a/maintenance/sqlite/archives/patch-drop-ss_admins.sql b/maintenance/sqlite/archives/patch-drop-ss_admins.sql new file mode 100644 index 00000000..9951e17e --- /dev/null +++ b/maintenance/sqlite/archives/patch-drop-ss_admins.sql @@ -0,0 +1,22 @@ +-- field is deprecated and no longer updated as of 1.5 +CREATE TABLE /*_*/site_stats_tmp ( + ss_row_id int unsigned NOT NULL, + ss_total_views bigint unsigned default 0, + ss_total_edits bigint unsigned default 0, + ss_good_articles bigint unsigned default 0, + ss_total_pages bigint default '-1', + ss_users bigint default '-1', + ss_active_users bigint default '-1', + ss_images int default 0 +) /*$wgDBTableOptions*/; + +INSERT INTO /*_*/site_stats_tmp + SELECT ss_row_id, ss_total_views, ss_total_edits, ss_good_articles, + ss_total_pages, ss_users, ss_active_users, ss_images + FROM /*_*/site_stats; + +DROP TABLE /*_*/site_stats; + +ALTER TABLE /*_*/site_stats_tmp RENAME TO /*_*/site_stats; + +CREATE UNIQUE INDEX /*i*/ss_row_id ON /*_*/site_stats (ss_row_id);
\ No newline at end of file diff --git a/maintenance/sqlite/archives/patch-job_token.sql b/maintenance/sqlite/archives/patch-job_token.sql new file mode 100644 index 00000000..4e4d28fd --- /dev/null +++ b/maintenance/sqlite/archives/patch-job_token.sql @@ -0,0 +1,8 @@ +ALTER TABLE /*_*/job ADD COLUMN job_random integer unsigned NOT NULL default 0; +ALTER TABLE /*_*/job ADD COLUMN job_token varbinary(32) NOT NULL default ''; +ALTER TABLE /*_*/job ADD COLUMN job_sha1 varbinary(32) NOT NULL default ''; +ALTER TABLE /*_*/job ADD COLUMN job_token_timestamp varbinary(14) NULL default NULL; + +CREATE INDEX /*i*/job_sha1 ON /*_*/job (job_sha1); +CREATE INDEX /*i*/job_cmd_token ON /*_*/job (job_cmd,job_token,job_random); + diff --git a/maintenance/sqlite/archives/patch-profiling.sql b/maintenance/sqlite/archives/patch-profiling.sql new file mode 100644 index 00000000..4a07283c --- /dev/null +++ b/maintenance/sqlite/archives/patch-profiling.sql @@ -0,0 +1,12 @@ +-- profiling table +-- This is optional + +CREATE TABLE /*_*/profiling ( + pf_count int NOT NULL default 0, + pf_time float NOT NULL default 0, + pf_memory float NOT NULL default 0, + pf_name varchar(255) NOT NULL default '', + pf_server varchar(30) NOT NULL default '' +); + +CREATE UNIQUE INDEX /*i*/pf_name_server ON /*_*/profiling (pf_name, pf_server); diff --git a/maintenance/sqlite/archives/patch-rc_moved.sql b/maintenance/sqlite/archives/patch-rc_moved.sql new file mode 100644 index 00000000..70248d54 --- /dev/null +++ b/maintenance/sqlite/archives/patch-rc_moved.sql @@ -0,0 +1,46 @@ +-- rc_moved_to_ns and rc_moved_to_title is no longer used, delete the fields + +CREATE TABLE /*_*/recentchanges_tmp ( + rc_id int NOT NULL PRIMARY KEY AUTO_INCREMENT, + rc_timestamp varbinary(14) NOT NULL default '', + rc_cur_time varbinary(14) NOT NULL default '', + rc_user int unsigned NOT NULL default 0, + rc_user_text varchar(255) binary NOT NULL, + rc_namespace int NOT NULL default 0, + rc_title varchar(255) binary NOT NULL default '', + rc_comment varchar(255) binary NOT NULL default '', + rc_minor tinyint unsigned NOT NULL default 0, + rc_bot tinyint unsigned NOT NULL default 0, + rc_new tinyint unsigned NOT NULL default 0, + rc_cur_id int unsigned NOT NULL default 0, + rc_this_oldid int unsigned NOT NULL default 0, + rc_last_oldid int unsigned NOT NULL default 0, + rc_type tinyint unsigned NOT NULL default 0, + rc_patrolled tinyint unsigned NOT NULL default 0, + rc_ip varbinary(40) NOT NULL default '', + rc_old_len int, + rc_new_len int, + rc_deleted tinyint unsigned NOT NULL default 0, + rc_logid int unsigned NOT NULL default 0, + rc_log_type varbinary(255) NULL default NULL, + rc_log_action varbinary(255) NULL default NULL, + rc_params blob NULL +) /*$wgDBTableOptions*/; + +INSERT INTO /*_*/recentchanges_tmp + SELECT rc_id, rc_timestamp, rc_cur_time, rc_user, rc_user_text, rc_namespace, rc_title, rc_comment, + rc_minor, rc_bot, rc_new, rc_cur_id, rc_this_oldid, rc_last_oldid, rc_type, rc_patrolled, rc_ip, + rc_old_len, rc_new_len, rc_deleted, rc_logid, rc_log_type, rc_log_action, rc_params + FROM /*_*/recentchanges; + +DROP TABLE /*_*/recentchanges; + +ALTER TABLE /*_*/recentchanges_tmp RENAME TO /*_*/recentchanges; + +CREATE INDEX /*i*/rc_timestamp ON /*_*/recentchanges (rc_timestamp); +CREATE INDEX /*i*/rc_namespace_title ON /*_*/recentchanges (rc_namespace, rc_title); +CREATE INDEX /*i*/rc_cur_id ON /*_*/recentchanges (rc_cur_id); +CREATE INDEX /*i*/new_name_timestamp ON /*_*/recentchanges (rc_new,rc_namespace,rc_timestamp); +CREATE INDEX /*i*/rc_ip ON /*_*/recentchanges (rc_ip); +CREATE INDEX /*i*/rc_ns_usertext ON /*_*/recentchanges (rc_namespace, rc_user_text); +CREATE INDEX /*i*/rc_user_text ON /*_*/recentchanges (rc_user_text, rc_timestamp); diff --git a/maintenance/sqlite/archives/patch-rename-iwl_prefix.sql b/maintenance/sqlite/archives/patch-rename-iwl_prefix.sql index 851a6b37..fd4c9ec7 100644 --- a/maintenance/sqlite/archives/patch-rename-iwl_prefix.sql +++ b/maintenance/sqlite/archives/patch-rename-iwl_prefix.sql @@ -1,4 +1,4 @@ --- +-- -- Recreates the iwl_prefix for the iwlinks table -- DROP INDEX IF EXISTS /*i*/iwl_prefix; diff --git a/maintenance/sqlite/archives/patch-sites.sql b/maintenance/sqlite/archives/patch-sites.sql new file mode 100644 index 00000000..88392748 --- /dev/null +++ b/maintenance/sqlite/archives/patch-sites.sql @@ -0,0 +1,71 @@ +-- Patch to add the sites and site_identifiers tables. +-- Licence: GNU GPL v2+ +-- Author: Jeroen De Dauw < jeroendedauw@gmail.com > + + +-- Holds all the sites known to the wiki. +CREATE TABLE IF NOT EXISTS /*_*/sites ( +-- Numeric id of the site + site_id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, + + -- Global identifier for the site, ie 'enwiktionary' + site_global_key varbinary(32) NOT NULL, + + -- Type of the site, ie 'mediawiki' + site_type varbinary(32) NOT NULL, + + -- Group of the site, ie 'wikipedia' + site_group varbinary(32) NOT NULL, + + -- Source of the site data, ie 'local', 'wikidata', 'my-magical-repo' + site_source varbinary(32) NOT NULL, + + -- Language code of the sites primary language. + site_language varbinary(32) NOT NULL, + + -- Protocol of the site, ie 'http://', 'irc://', '//' + -- This field is an index for lookups and is build from type specific data in site_data. + site_protocol varbinary(32) NOT NULL, + + -- Domain of the site in reverse order, ie 'org.mediawiki.www.' + -- This field is an index for lookups and is build from type specific data in site_data. + site_domain VARCHAR(255) NOT NULL, + + -- Type dependent site data. + site_data BLOB NOT NULL, + + -- If site.tld/path/key:pageTitle should forward users to the page on + -- the actual site, where "key" is the local identifier. + site_forward bool NOT NULL, + + -- Type dependent site config. + -- For instance if template transclusion should be allowed if it's a MediaWiki. + site_config BLOB NOT NULL +) /*$wgDBTableOptions*/; + +CREATE UNIQUE INDEX /*i*/sites_global_key ON /*_*/sites (site_global_key); +CREATE INDEX /*i*/sites_type ON /*_*/sites (site_type); +CREATE INDEX /*i*/sites_group ON /*_*/sites (site_group); +CREATE INDEX /*i*/sites_source ON /*_*/sites (site_source); +CREATE INDEX /*i*/sites_language ON /*_*/sites (site_language); +CREATE INDEX /*i*/sites_protocol ON /*_*/sites (site_protocol); +CREATE INDEX /*i*/sites_domain ON /*_*/sites (site_domain); +CREATE INDEX /*i*/sites_forward ON /*_*/sites (site_forward); + + + +-- Links local site identifiers to their corresponding site. +CREATE TABLE IF NOT EXISTS /*_*/site_identifiers ( + -- Key on site.site_id + si_site INT UNSIGNED NOT NULL, + + -- local key type, ie 'interwiki' or 'langlink' + si_type varbinary(32) NOT NULL, + + -- local key value, ie 'en' or 'wiktionary' + si_key varbinary(32) NOT NULL +) /*$wgDBTableOptions*/; + +CREATE UNIQUE INDEX /*i*/site_ids_type ON /*_*/site_identifiers (si_type, si_key); +CREATE INDEX /*i*/site_ids_site ON /*_*/site_identifiers (si_site); +CREATE INDEX /*i*/site_ids_key ON /*_*/site_identifiers (si_key);
\ No newline at end of file diff --git a/maintenance/sqlite/archives/patch-ufg_group-length-increase.sql b/maintenance/sqlite/archives/patch-ufg_group-length-increase-255.sql index c6dcea5e..edd0a3dc 100644 --- a/maintenance/sqlite/archives/patch-ufg_group-length-increase.sql +++ b/maintenance/sqlite/archives/patch-ufg_group-length-increase-255.sql @@ -1,11 +1,11 @@ -CREATE TABLE /*_*/user_former_groups_tmp ( - ug_user int unsigned NOT NULL default 0, - ug_group varbinary(32) NOT NULL default '' + CREATE TABLE /*_*/user_former_groups_tmp ( + ufg_user int unsigned NOT NULL default 0, + ufg_group varbinary(255) NOT NULL default '' ) /*$wgDBTableOptions*/; INSERT INTO /*_*/user_former_groups_tmp - SELECT ug_user, ug_group - FROM /*_*/user_groups; + SELECT ufg_user, ufg_group + FROM /*_*/user_former_groups; DROP TABLE /*_*/user_former_groups; diff --git a/maintenance/sqlite/archives/patch-ug_group-length-increase.sql b/maintenance/sqlite/archives/patch-ug_group-length-increase-255.sql index 5e810937..3daeb7c6 100644 --- a/maintenance/sqlite/archives/patch-ug_group-length-increase.sql +++ b/maintenance/sqlite/archives/patch-ug_group-length-increase-255.sql @@ -1,6 +1,6 @@ CREATE TABLE /*_*/user_groups_tmp ( ug_user int unsigned NOT NULL default 0, - ug_group varbinary(32) NOT NULL default '' + ug_group varbinary(255) NOT NULL default '' ) /*$wgDBTableOptions*/; INSERT INTO /*_*/user_groups_tmp diff --git a/maintenance/sqlite/archives/searchindex-fts3.sql b/maintenance/sqlite/archives/searchindex-fts3.sql index 28554c02..2a370940 100644 --- a/maintenance/sqlite/archives/searchindex-fts3.sql +++ b/maintenance/sqlite/archives/searchindex-fts3.sql @@ -1,7 +1,7 @@ -- 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, +-- Will fail if FTS3 is not present, DROP TABLE IF EXISTS /*_*/searchindex; CREATE VIRTUAL TABLE /*_*/searchindex USING FTS3( -- Key to page_id @@ -10,7 +10,7 @@ CREATE VIRTUAL TABLE /*_*/searchindex USING FTS3( -- Munged version of title si_title, - + -- Munged version of body text si_text ); diff --git a/maintenance/sqlite/archives/searchindex-no-fts.sql b/maintenance/sqlite/archives/searchindex-no-fts.sql index bc014b3d..16247ffe 100644 --- a/maintenance/sqlite/archives/searchindex-no-fts.sql +++ b/maintenance/sqlite/archives/searchindex-no-fts.sql @@ -17,7 +17,7 @@ CREATE TABLE /*_*/searchindex ( -- Munged version of title si_title TEXT, - + -- Munged version of body text si_text TEXT ); |