Index: branches/robchurch/newtalk/maintenance/archives/patch-fix-newtalk.sql |
— | — | @@ -1,9 +1,7 @@ |
2 | 2 | -- Alters columns in `user_newtalk` to be nullable and |
3 | 3 | -- drops existing indices in favour of a single UNIQUE |
4 | 4 | -- index |
5 | | -ALTER TABLE /*wgDBprefix*/user_newtalk |
6 | | -DROP INDEX `user_id`, |
7 | | -DROP INDEX `user_ip`, |
8 | | -CHANGE `user_id` `user_id` INT(5) NULL, |
| 5 | +ALTER TABLE /*$wgDBprefix*/user_newtalk DROP INDEX `user_id`, |
| 6 | +DROP INDEX `user_ip`, CHANGE `user_id` `user_id` INT(5) NULL, |
9 | 7 | CHANGE `user_ip` `user_ip` VARCHAR(40) NULL, |
10 | | -ADD UNIQUE( `user_id`, `user_ip` ) |
| 8 | +ADD UNIQUE( `user_id`, `user_ip` ); |
\ No newline at end of file |
Index: branches/robchurch/newtalk/maintenance/tables.sql |
— | — | @@ -161,17 +161,16 @@ |
162 | 162 | -- Stores notifications of user talk page changes, for the display |
163 | 163 | -- of the "you have new messages" box |
164 | 164 | CREATE TABLE /*$wgDBprefix*/user_newtalk ( |
165 | | - -- Key to user.user_id |
166 | | - user_id int(5) NOT NULL default '0', |
167 | | - -- If the user is an anonymous user their IP address is stored here |
168 | | - -- since the user_id of 0 is ambiguous |
169 | | - user_ip varchar(40) NOT NULL default '', |
170 | | - INDEX user_id (user_id), |
171 | | - INDEX user_ip (user_ip) |
172 | 165 | |
| 166 | + -- User identifier if it's a registered account |
| 167 | + user_id INT(5) NULL, |
| 168 | + -- IP address if it's not a registered account |
| 169 | + user_ip VARCHAR(40) NULL, |
| 170 | + |
| 171 | + UNIQUE( `user_ip` ) |
| 172 | + |
173 | 173 | ) /*$wgDBTableOptions*/; |
174 | 174 | |
175 | | - |
176 | 175 | -- |
177 | 176 | -- Core of the wiki: each page has an entry here which identifies |
178 | 177 | -- it by title and contains some essential metadata. |