Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -2394,6 +2394,7 @@ |
2395 | 2395 | $wgExtNewIndexes[] = array('flaggedpage_config', 'fpc_expiry', "$base/postgres/patch-expiry-index.sql" ); |
2396 | 2396 | $wgExtNewTables[] = array( 'flaggedrevs_promote', "$base/postgres/patch-flaggedrevs_promote.sql" ); |
2397 | 2397 | $wgExtNewTables[] = array( 'flaggedpages', "$base/postgres/patch-flaggedpages.sql" ); |
| 2398 | + $wgExtNewIndexes[] = array('flaggedrevs', 'key_timestamp', "$base/postgres/patch-fr_img_name.sql" ); |
2398 | 2399 | } |
2399 | 2400 | |
2400 | 2401 | return true; |
Index: trunk/extensions/FlaggedRevs/postgres/patch-fr_img_name.sql |
— | — | @@ -0,0 +1,13 @@ |
| 2 | +BEGIN; |
| 3 | + |
| 4 | +ALTER TABLE flaggedrevs |
| 5 | + -- Name of included image |
| 6 | + ADD fr_img_name TEXT NULL default NULL, |
| 7 | + -- Timestamp of file (when uploaded) |
| 8 | + ADD fr_img_timestamp TIMESTAMPTZ NULL default NULL, |
| 9 | + -- Statistically unique SHA-1 key |
| 10 | + ADD fr_img_sha1 TEXT NULL default NULL; |
| 11 | + |
| 12 | +CREATE INDEX key_timestamp ON flaggedrevs (fr_img_sha1,fr_img_timestamp); |
| 13 | + |
| 14 | +COMMIT; |
Property changes on: trunk/extensions/FlaggedRevs/postgres/patch-fr_img_name.sql |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 15 | + native |
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.pg.sql |
— | — | @@ -4,28 +4,32 @@ |
5 | 5 | BEGIN; |
6 | 6 | |
7 | 7 | CREATE TABLE flaggedpages ( |
8 | | - fp_page_id INTEGER NOT NULL DEFAULT 0 , |
9 | | - fp_reviewed INTEGER NOT NULL DEFAULT 0 , |
10 | | - fp_stable INTEGER NULL, |
11 | | - fp_quality INTEGER default NULL, |
| 8 | + fp_page_id INTEGER NOT NULL DEFAULT 0, |
| 9 | + fp_reviewed INTEGER NOT NULL DEFAULT 0, |
| 10 | + fp_stable INTEGER NOT NULL DEFAULT 0, |
| 11 | + fp_quality INTEGER default NULL, |
12 | 12 | PRIMARY KEY (fp_page_id) |
13 | 13 | ); |
14 | 14 | CREATE INDEX fp_reviewed_page ON flaggedpages (fp_reviewed,fp_page_id), |
15 | 15 | CREATE INDEX fp_quality_page ON flaggedpages (fp_quality,fp_page_id) |
16 | 16 | |
17 | 17 | CREATE TABLE flaggedrevs ( |
18 | | - fr_page_id INTEGER NOT NULL DEFAULT 0 , |
19 | | - fr_rev_id INTEGER NOT NULL DEFAULT 0 , |
20 | | - fr_user INTEGER NULL REFERENCES mwuser(user_id) ON DELETE SET NULL, |
21 | | - fr_timestamp TIMESTAMPTZ, |
22 | | - fr_comment TEXT NOT NULL DEFAULT '', |
23 | | - fr_quality INTEGER NOT NULL DEFAULT 0, |
24 | | - fr_tags TEXT NOT NULL DEFAULT '', |
25 | | - fr_text TEXT NOT NULL DEFAULT '', |
26 | | - fr_flags TEXT NOT NULL, |
| 18 | + fr_page_id INTEGER NOT NULL DEFAULT 0, |
| 19 | + fr_rev_id INTEGER NOT NULL DEFAULT 0, |
| 20 | + fr_user INTEGER NULL REFERENCES mwuser(user_id) ON DELETE SET NULL, |
| 21 | + fr_timestamp TIMESTAMPTZ, |
| 22 | + fr_comment TEXT NOT NULL DEFAULT '', |
| 23 | + fr_quality INTEGER NOT NULL DEFAULT 0, |
| 24 | + fr_tags TEXT NOT NULL DEFAULT '', |
| 25 | + fr_text TEXT NOT NULL DEFAULT '', |
| 26 | + fr_flags TEXT NOT NULL, |
| 27 | + fr_img_name TEXT NULL DEFAULT NULL, |
| 28 | + fr_img_timestamp TIMESTAMPTZ NULL DEFAULT NULL, |
| 29 | + fr_img_sha1 TEXT NULL DEFAULT NULL, |
27 | 30 | PRIMARY KEY (fr_page_id,fr_rev_id) |
28 | 31 | ); |
29 | 32 | CREATE INDEX fr_namespace_title ON flaggedrevs (fr_page_id,fr_quality,fr_rev_id); |
| 33 | +CREATE INDEX key_timestamp ON flaggedrevs (fr_img_sha1,fr_img_timestamp); |
30 | 34 | |
31 | 35 | CREATE TABLE flaggedpage_config ( |
32 | 36 | fpc_page_id INTEGER NOT NULL PRIMARY KEY DEFAULT 0, |
— | — | @@ -44,7 +48,7 @@ |
45 | 49 | ); |
46 | 50 | |
47 | 51 | CREATE TABLE flaggedimages ( |
48 | | - fi_rev_id INTEGER NOT NULL DEFAULT 0 , |
| 52 | + fi_rev_id INTEGER NOT NULL DEFAULT 0, |
49 | 53 | fi_name TEXT NOT NULL, |
50 | 54 | fi_img_timestamp TIMESTAMPTZ, |
51 | 55 | fi_img_sha1 CHAR(64), |