Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php |
— | — | @@ -2083,24 +2083,24 @@ |
2084 | 2084 | $wgExtNewTables[] = array( 'flaggedrevs', "$base/FlaggedRevs.sql" ); |
2085 | 2085 | // Updates (in order)... |
2086 | 2086 | $wgExtNewFields[] = array( 'flaggedpage_config', |
2087 | | - 'fpc_expiry', "$base/archives/patch-fpc_expiry.sql" ); |
| 2087 | + 'fpc_expiry', "$base/mysql/patch-fpc_expiry.sql" ); |
2088 | 2088 | $wgExtNewIndexes[] = array( 'flaggedpage_config', |
2089 | | - 'fpc_expiry', "$base/archives/patch-expiry-index.sql" ); |
| 2089 | + 'fpc_expiry', "$base/mysql/patch-expiry-index.sql" ); |
2090 | 2090 | $wgExtNewTables[] = array( 'flaggedrevs_promote', |
2091 | | - "$base/archives/patch-flaggedrevs_promote.sql" ); |
2092 | | - $wgExtNewTables[] = array( 'flaggedpages', "$base/archives/patch-flaggedpages.sql" ); |
| 2091 | + "$base/mysql/patch-flaggedrevs_promote.sql" ); |
| 2092 | + $wgExtNewTables[] = array( 'flaggedpages', "$base/mysql/patch-flaggedpages.sql" ); |
2093 | 2093 | $wgExtNewFields[] = array( 'flaggedrevs', |
2094 | | - 'fr_img_name', "$base/archives/patch-fr_img_name.sql" ); |
| 2094 | + 'fr_img_name', "$base/mysql/patch-fr_img_name.sql" ); |
2095 | 2095 | $wgExtNewTables[] = array( 'flaggedrevs_tracking', |
2096 | | - "$base/archives/patch-flaggedrevs_tracking.sql" ); |
| 2096 | + "$base/mysql/patch-flaggedrevs_tracking.sql" ); |
2097 | 2097 | $wgExtNewFields[] = array( 'flaggedpages', 'fp_pending_since', |
2098 | | - "$base/archives/patch-fp_pending_since.sql" ); |
| 2098 | + "$base/mysql/patch-fp_pending_since.sql" ); |
2099 | 2099 | $wgExtNewFields[] = array( 'flaggedpage_config', 'fpc_level', |
2100 | | - "$base/archives/patch-fpc_level.sql" ); |
| 2100 | + "$base/mysql/patch-fpc_level.sql" ); |
2101 | 2101 | $wgExtNewTables[] = array( 'flaggedpage_pending', |
2102 | | - "$base/archives/patch-flaggedpage_pending.sql" ); |
| 2102 | + "$base/mysql/patch-flaggedpage_pending.sql" ); |
2103 | 2103 | $wgExtNewTables[] = array( 'flaggedrevs_stats', |
2104 | | - "$base/archives/patch-flaggedrevs_stats.sql" ); |
| 2104 | + "$base/mysql/patch-flaggedrevs_stats.sql" ); |
2105 | 2105 | } elseif ( $wgDBtype == 'postgres' ) { |
2106 | 2106 | // Initial install tables (current schema) |
2107 | 2107 | $wgExtNewTables[] = array( 'flaggedrevs', "$base/FlaggedRevs.pg.sql" ); |
Index: trunk/extensions/FlaggedRevs/mysql/patch-expiry-index.sql |
— | — | @@ -0,0 +1,4 @@ |
| 2 | +-- Add expiration column index |
| 3 | + |
| 4 | +ALTER TABLE /*$wgDBprefix*/flaggedpage_config |
| 5 | + ADD INDEX (fpc_expiry); |
Property changes on: trunk/extensions/FlaggedRevs/mysql/patch-expiry-index.sql |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 6 | + native |
Index: trunk/extensions/FlaggedRevs/mysql/patch-flaggedrevs_stats.sql |
— | — | @@ -0,0 +1,14 @@ |
| 2 | +-- Various statistics about the reviewed namespaces |
| 3 | +CREATE TABLE /*_*/flaggedrevs_stats ( |
| 4 | + namespace int unsigned NOT NULL DEFAULT 0 PRIMARY KEY, |
| 5 | + total int unsigned NOT NULL DEFAULT 0, |
| 6 | + reviewed int unsigned NOT NULL DEFAULT 0, |
| 7 | + synced int unsigned NOT NULL DEFAULT 0 |
| 8 | +) /*$wgDBTableOptions*/; |
| 9 | + |
| 10 | +CREATE TABLE /*_*/flaggedrevs_stats2 ( |
| 11 | + stat_id int unsigned NOT NULL DEFAULT 1 PRIMARY KEY, |
| 12 | + ave_review_time int unsigned NOT NULL DEFAULT 0, |
| 13 | + med_review_time int unsigned NOT NULL DEFAULT 0, |
| 14 | + ave_pending_time int unsigned NOT NULL DEFAULT 0 |
| 15 | +) /*$wgDBTableOptions*/; |
Property changes on: trunk/extensions/FlaggedRevs/mysql/patch-flaggedrevs_stats.sql |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 16 | + native |
Index: trunk/extensions/FlaggedRevs/mysql/patch-fpc_expiry.sql |
— | — | @@ -0,0 +1,4 @@ |
| 2 | +-- Add expiration column |
| 3 | + |
| 4 | +ALTER TABLE /*$wgDBprefix*/flaggedpage_config |
| 5 | + ADD fpc_expiry varbinary(14) NOT NULL default 'infinity'; |
Property changes on: trunk/extensions/FlaggedRevs/mysql/patch-fpc_expiry.sql |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 6 | + native |
Index: trunk/extensions/FlaggedRevs/mysql/patch-flaggedpages.sql |
— | — | @@ -0,0 +1,24 @@ |
| 2 | +-- Add page metadata for flaggedrevs |
| 3 | +CREATE TABLE /*$wgDBprefix*/flaggedpages ( |
| 4 | + -- Foreign key to page.page_id |
| 5 | + fp_page_id integer unsigned NOT NULL, |
| 6 | + -- Is the page reviewed up to date? |
| 7 | + fp_reviewed bool NOT NULL default '0', |
| 8 | + -- Foreign key to flaggedrevs.fr_rev_id |
| 9 | + fp_stable integer unsigned NOT NULL, |
| 10 | + -- The highest quality of the page's reviewed revisions. |
| 11 | + -- Note that this may not be set to display by default though. |
| 12 | + fp_quality tinyint(1) default NULL, |
| 13 | + |
| 14 | + PRIMARY KEY (fp_page_id), |
| 15 | + INDEX fp_reviewed_page (fp_reviewed,fp_page_id), |
| 16 | + INDEX fp_quality_page (fp_quality,fp_page_id) |
| 17 | +) /*$wgDBTableOptions*/; |
| 18 | + |
| 19 | +-- Migrate old page_ext hacks over |
| 20 | +INSERT INTO /*$wgDBprefix*/flaggedpages (fp_page_id,fp_reviewed,fp_stable,fp_quality) |
| 21 | +SELECT page_id,page_ext_reviewed,page_ext_stable,page_ext_quality FROM /*$wgDBprefix*/page |
| 22 | +WHERE page_ext_stable IS NOT NULL; |
| 23 | + |
| 24 | +-- Leave the old fields for now |
| 25 | +ALTER TABLE /*$wgDBprefix*/page DROP INDEX ext_namespace_reviewed; |
Property changes on: trunk/extensions/FlaggedRevs/mysql/patch-flaggedpages.sql |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 26 | + native |
Index: trunk/extensions/FlaggedRevs/mysql/patch-flaggedpage_pending.sql |
— | — | @@ -0,0 +1,15 @@ |
| 2 | +-- Add tracking table for edits needing review (for all levels) |
| 3 | +CREATE TABLE IF NOT EXISTS /*$wgDBprefix*/flaggedpage_pending ( |
| 4 | + -- Foreign key to page.page_id |
| 5 | + fpp_page_id integer unsigned NOT NULL, |
| 6 | + -- The quality tier (0=stable, 1=quality, 2=pristine) |
| 7 | + fpp_quality tinyint(1) NOT NULL, |
| 8 | + -- The last rev ID with this quality |
| 9 | + fpp_rev_id integer unsigned NOT NULL, |
| 10 | + -- Time (or NULL) of the first edit after the last revision reviewed to this level |
| 11 | + fpp_pending_since char(14) NOT NULL, |
| 12 | + |
| 13 | + PRIMARY KEY (fpp_page_id,fpp_quality), |
| 14 | + INDEX fpp_quality_pending (fpp_quality,fpp_pending_since) |
| 15 | +) /*$wgDBTableOptions*/; |
| 16 | + |
Property changes on: trunk/extensions/FlaggedRevs/mysql/patch-flaggedpage_pending.sql |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 17 | + native |
Index: trunk/extensions/FlaggedRevs/mysql/patch-fp_pending_since.sql |
— | — | @@ -0,0 +1,4 @@ |
| 2 | +-- Add timestamp column of first unreviewed rev for flaggedrevs |
| 3 | +ALTER TABLE /*$wgDBprefix*/flaggedpages |
| 4 | + ADD fp_pending_since char(14) NULL, |
| 5 | + ADD INDEX fp_pending_since (fp_pending_since); |
Property changes on: trunk/extensions/FlaggedRevs/mysql/patch-fp_pending_since.sql |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 6 | + native |
Index: trunk/extensions/FlaggedRevs/mysql/patch-flaggedrevs_tracking.sql |
— | — | @@ -0,0 +1,8 @@ |
| 2 | +-- Track includes/links only in stable versions |
| 3 | +CREATE TABLE /*$wgDBprefix*/flaggedrevs_tracking ( |
| 4 | + ftr_from integer unsigned NOT NULL default '0', |
| 5 | + ftr_namespace int NOT NULL default '0', |
| 6 | + ftr_title varchar(255) binary NOT NULL default '', |
| 7 | + PRIMARY KEY (ftr_from,ftr_namespace,ftr_title), |
| 8 | + INDEX namespace_title_from (ftr_namespace,ftr_title,ftr_from) |
| 9 | +) /*$wgDBTableOptions*/; |
Property changes on: trunk/extensions/FlaggedRevs/mysql/patch-flaggedrevs_tracking.sql |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 10 | + native |
Index: trunk/extensions/FlaggedRevs/mysql/patch-fi_img_timestamp.sql |
— | — | @@ -0,0 +1,6 @@ |
| 2 | +-- Fix bad fi_img_timestamp definition |
| 3 | +ALTER TABLE /*$wgDBprefix*/flaggedimages |
| 4 | + CHANGE fi_img_timestamp fi_img_timestamp char(14) NULL; |
| 5 | +-- Move bad values over to NULL |
| 6 | +UPDATE /*$wgDBprefix*/flaggedimages |
| 7 | + SET fi_img_timestamp = NULL WHERE LOCATE( '\0', fi_img_timestamp ); |
Property changes on: trunk/extensions/FlaggedRevs/mysql/patch-fi_img_timestamp.sql |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 8 | + native |
Index: trunk/extensions/FlaggedRevs/mysql/patch-flaggedrevs_promote.sql |
— | — | @@ -0,0 +1,9 @@ |
| 2 | +-- This stores user demotions and stats |
| 3 | +CREATE TABLE /*$wgDBprefix*/flaggedrevs_promote ( |
| 4 | + -- Foreign key to user.user_id |
| 5 | + frp_user_id integer unsigned NOT NULL, |
| 6 | + frp_user_params mediumblob NOT NULL default '', |
| 7 | + |
| 8 | + PRIMARY KEY (frp_user_id) |
| 9 | +) /*$wgDBTableOptions*/; |
| 10 | + |
Property changes on: trunk/extensions/FlaggedRevs/mysql/patch-flaggedrevs_promote.sql |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 11 | + native |
Index: trunk/extensions/FlaggedRevs/mysql/patch-fpc_level.sql |
— | — | @@ -0,0 +1,3 @@ |
| 2 | +-- The protection level (Sysop, autoconfirmed, etc) for autoreview |
| 3 | +ALTER TABLE /*$wgDBprefix*/flaggedpage_config |
| 4 | + ADD fpc_level varbinary(60) NULL; |
Property changes on: trunk/extensions/FlaggedRevs/mysql/patch-fpc_level.sql |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 5 | + native |
Index: trunk/extensions/FlaggedRevs/mysql/patch-fr_img_name.sql |
— | — | @@ -0,0 +1,9 @@ |
| 2 | +-- Add file metadata for flaggedrevs of image pages |
| 3 | +ALTER TABLE /*$wgDBprefix*/flaggedrevs |
| 4 | + -- Name of included image |
| 5 | + ADD fr_img_name varchar(255) binary NULL default NULL, |
| 6 | + -- Timestamp of file (when uploaded) |
| 7 | + ADD fr_img_timestamp char(14) NULL default NULL, |
| 8 | + -- Statistically unique SHA-1 key |
| 9 | + ADD fr_img_sha1 varbinary(32) NULL default NULL, |
| 10 | + ADD INDEX fr_img_sha1 (fr_img_sha1); |
Property changes on: trunk/extensions/FlaggedRevs/mysql/patch-fr_img_name.sql |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 11 | + native |