Index: trunk/extensions/ArticleFeedback/sql/AddPageRevisionColumn.sql |
— | — | @@ -1,4 +0,0 @@ |
2 | | -ALTER TABLE /*_*/article_feedback_pages |
3 | | - ADD aap_revision integer unsigned NOT NULL, |
4 | | - DROP PRIMARY KEY, |
5 | | - ADD PRIMARY KEY (aap_page_id, aap_rating_id, aap_revision); |
\ No newline at end of file |
Index: trunk/extensions/ArticleFeedback/sql/ArticleFeedback.sql |
— | — | @@ -34,15 +34,12 @@ |
35 | 35 | -- 1 vote per user per revision |
36 | 36 | PRIMARY KEY (aa_revision, aa_user_text, aa_rating_id, aa_user_anon_token) |
37 | 37 | ) /*$wgDBTableOptions*/; |
38 | | -CREATE INDEX /*i*/aa_user_page_revision ON /*_*/article_feedback |
39 | | - (aa_user_id, aa_page_id, aa_revision); |
| 38 | +CREATE INDEX /*i*/aa_user_page_revision ON /*_*/article_feedback (aa_user_id, aa_page_id, aa_revision); |
40 | 39 | |
41 | 40 | -- Aggregate rating table for a page |
42 | 41 | CREATE TABLE IF NOT EXISTS /*_*/article_feedback_pages ( |
43 | 42 | -- Foreign key to page.page_id |
44 | 43 | aap_page_id integer unsigned NOT NULL, |
45 | | - -- Revision that totals are relevant to |
46 | | - aap_revision integer unsigned NOT NULL, |
47 | 44 | -- Foreign key to article_feedback_ratings.aar_rating |
48 | 45 | aap_rating_id integer unsigned NOT NULL, |
49 | 46 | -- Sum (total) of all the ratings for this article revision |
— | — | @@ -50,7 +47,7 @@ |
51 | 48 | -- Number of ratings |
52 | 49 | aap_count integer unsigned NOT NULL, |
53 | 50 | -- One rating row per page |
54 | | - PRIMARY KEY (aap_page_id, aap_rating_id, aap_revision) |
| 51 | + PRIMARY KEY (aap_page_id, aap_rating_id) |
55 | 52 | ) /*$wgDBTableOptions*/; |
56 | 53 | |
57 | 54 | -- Aggregate rating table for a revision |
— | — | @@ -76,6 +73,7 @@ |
77 | 74 | afp_revision integer unsigned NOT NULL, |
78 | 75 | afp_user_text varbinary(255) NOT NULL, |
79 | 76 | afp_user_anon_token varbinary(32) NOT NULL DEFAULT '', |
| 77 | + |
80 | 78 | -- Key/value pairs |
81 | 79 | afp_key varbinary(255) NOT NULL, |
82 | 80 | -- Integer value |
— | — | @@ -83,5 +81,4 @@ |
84 | 82 | -- Text value |
85 | 83 | afp_value_text varbinary(255) DEFAULT '' NOT NULL |
86 | 84 | ) /*$wgDBTableOptions*/; |
87 | | -CREATE UNIQUE INDEX /*i*/afp_rating_key ON /*_*/article_feedback_properties |
88 | | - (afp_revision, afp_user_text, afp_user_anon_token, afp_key); |
| 85 | +CREATE UNIQUE INDEX /*i*/afp_rating_key ON /*_*/article_feedback_properties (afp_revision, afp_user_text, afp_user_anon_token, afp_key); |
Index: trunk/extensions/ArticleFeedback/ArticleFeedback.hooks.php |
— | — | @@ -137,15 +137,6 @@ |
138 | 138 | true |
139 | 139 | ) ); |
140 | 140 | } |
141 | | - if ( !$db->fieldExists( 'article_feedback_pages', 'aap_revision', __METHOD__ ) ) { |
142 | | - $updater->addExtensionUpdate( array( |
143 | | - 'addField', |
144 | | - 'article_feedback_pages', |
145 | | - 'aap_revision', |
146 | | - $dir . '/sql/AddPageRevisionColumn.sql', |
147 | | - true |
148 | | - ) ); |
149 | | - } |
150 | 141 | $updater->addExtensionUpdate( array( |
151 | 142 | 'addTable', |
152 | 143 | 'article_feedback_properties', |
— | — | @@ -165,7 +156,7 @@ |
166 | 157 | } |
167 | 158 | return true; |
168 | 159 | } |
169 | | - |
| 160 | + |
170 | 161 | /** |
171 | 162 | * ParserTestTables hook |
172 | 163 | */ |