```lang=sql,name=SQL to be applied
ALTER TABLE watcher ADD basewiki int NULL;
UPDATE watcher SET basewiki = 1;
ALTER TABLE watcher
CHANGE basewiki basewiki int NOT NULL,
ADD CONSTRAINT watcher_site_site_id_fk FOREIGN KEY (basewiki) REFERENCES site (site_id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE channelwatchers DROP PRIMARY KEY;
ALTER TABLE channelwatchers
ADD id int NOT NULL auto_increment PRIMARY KEY FIRST,
ADD sleeptime int DEFAULT 1200 NOT NULL,
CHANGE cw_channel channel int(11) NOT NULL,
CHANGE cw_watcher watcher int(11) NOT NULL,
ADD CONSTRAINT channelwatchers_channel_channel_id_fk FOREIGN KEY (channel) REFERENCES channel (channel_id) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT channelwatchers_watcher_watcher_id_fk FOREIGN KEY (watcher) REFERENCES watcher (watcher_id) ON DELETE CASCADE ON UPDATE CASCADE;
UPDATE channelwatchers cw SET cw.sleeptime = (SELECT w.watcher_sleeptime FROM watcher w WHERE w.watcher_id = cw.watcher);
ALTER TABLE watcher
DROP COLUMN watcher_priority,
DROP COLUMN watcher_sleeptime,
CHANGE watcher_category category varchar(255) NOT NULL,
CHANGE watcher_keyword keyword varchar(10) NOT NULL;
```
```lang=xml,name=Configuration changes
<enableCategoryWatcher>true</enableCategoryWatcher>
```