summaryrefslogtreecommitdiff
path: root/www/wiki/maintenance/archives/patch-watchlist.sql
diff options
context:
space:
mode:
Diffstat (limited to 'www/wiki/maintenance/archives/patch-watchlist.sql')
-rw-r--r--www/wiki/maintenance/archives/patch-watchlist.sql30
1 files changed, 30 insertions, 0 deletions
diff --git a/www/wiki/maintenance/archives/patch-watchlist.sql b/www/wiki/maintenance/archives/patch-watchlist.sql
new file mode 100644
index 00000000..83826b72
--- /dev/null
+++ b/www/wiki/maintenance/archives/patch-watchlist.sql
@@ -0,0 +1,30 @@
+-- Convert watchlists to new new format ;)
+
+-- Ids just aren't convenient when what we want is to
+-- treat article and talk pages as equivalent.
+-- Better to use namespace (drop the 1 bit!) and title
+
+-- 2002-12-17 by Brion Vibber <brion@pobox.com>
+-- affects, affected by changes to SpecialWatchlist.php, User.php,
+-- Article.php, Title.php, SpecialRecentchanges.php
+
+DROP TABLE IF EXISTS watchlist2;
+CREATE TABLE watchlist2 (
+ wl_user int unsigned NOT NULL,
+ wl_namespace int unsigned NOT NULL default '0',
+ wl_title varchar(255) binary NOT NULL default '',
+ UNIQUE KEY (wl_user, wl_namespace, wl_title)
+) /*$wgDBTableOptions*/;
+
+INSERT INTO watchlist2 (wl_user,wl_namespace,wl_title)
+ SELECT DISTINCT wl_user,(cur_namespace | 1) - 1,cur_title
+ FROM watchlist,cur WHERE wl_page=cur_id;
+
+ALTER TABLE watchlist RENAME TO oldwatchlist;
+ALTER TABLE watchlist2 RENAME TO watchlist;
+
+-- Check that the new one is correct, then:
+-- DROP TABLE oldwatchlist;
+
+-- Also should probably drop the ancient and now unused:
+ALTER TABLE user DROP COLUMN user_watch;