Merge "Re add wpScrolltop id in EditPage"
[lhc/web/wiklou.git] / maintenance / archives / patch-watchlist.sql
1 -- Convert watchlists to new new format ;)
2
3 -- Ids just aren't convenient when what we want is to
4 -- treat article and talk pages as equivalent.
5 -- Better to use namespace (drop the 1 bit!) and title
6
7 -- 2002-12-17 by Brion Vibber <brion@pobox.com>
8 -- affects, affected by changes to SpecialWatchlist.php, User.php,
9 -- Article.php, Title.php, SpecialRecentchanges.php
10
11 DROP TABLE IF EXISTS watchlist2;
12 CREATE TABLE watchlist2 (
13 wl_user int unsigned NOT NULL,
14 wl_namespace int unsigned NOT NULL default '0',
15 wl_title varchar(255) binary NOT NULL default '',
16 UNIQUE KEY (wl_user, wl_namespace, wl_title)
17 ) /*$wgDBTableOptions*/;
18
19 INSERT INTO watchlist2 (wl_user,wl_namespace,wl_title)
20 SELECT DISTINCT wl_user,(cur_namespace | 1) - 1,cur_title
21 FROM watchlist,cur WHERE wl_page=cur_id;
22
23 ALTER TABLE watchlist RENAME TO oldwatchlist;
24 ALTER TABLE watchlist2 RENAME TO watchlist;
25
26 -- Check that the new one is correct, then:
27 -- DROP TABLE oldwatchlist;
28
29 -- Also should probably drop the ancient and now unused:
30 ALTER TABLE user DROP COLUMN user_watch;