Index: trunk/extensions/PageTriage/sql/PageTriage.sql |
— | — | @@ -1,5 +1,6 @@ |
2 | 2 | |
| 3 | +-- mapping table for users to revisions |
| 4 | +-- this information persists forever. |
3 | 5 | CREATE TABLE /*_*/pagetriage ( |
4 | 6 | ptr_user_id int UNSIGNED NOT NULL, |
5 | 7 | ptr_recentchanges_id int NOT NULL, |
— | — | @@ -9,4 +10,17 @@ |
10 | 11 | CREATE UNIQUE INDEX /*i*/ptr_user_rc ON /*_*/pagetriage (ptr_user_id,ptr_recentchanges_id); |
11 | 12 | |
12 | 13 | -- this stores when a page was checked. we'll be interested in that sometimes. |
13 | | -CREATE INDEX /*i*/ptr_timestamp ON /*_*/pagetriage (ptr_timestamp); |
\ No newline at end of file |
| 14 | +CREATE INDEX /*i*/ptr_timestamp ON /*_*/pagetriage (ptr_timestamp); |
| 15 | + |
| 16 | +-- This table exists to prevent concurrency problems when multiple people are doing |
| 17 | +-- page triage at the same time. |
| 18 | +-- Unlike the above table, this one has rows deleted from it regularly. |
| 19 | +-- If it's cleared, it'll lead to edit conflicts for a few minutes but it's not a big deal. |
| 20 | +CREATE TABLE /*_*/pagetriage_checkouts ( |
| 21 | + ptc_id int UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, |
| 22 | + ptc_user_id int UNSIGNED NOT NULL, |
| 23 | + ptc_recentchanges_id int NOT NULL, |
| 24 | + ptc_timestamp varbinary(14) NOT NULL |
| 25 | +) /*$wgDBTableOptions*/; |
| 26 | + |
| 27 | +CREATE UNIQUE INDEX /*i*/ptc_user_rc ON /*_*/pagetriage_checkouts (ptc_user_id,ptc_recentchanges_id); |