Index: trunk/extensions/ArticleFeedback/sql/AddRevisionsTable.sql |
— | — | @@ -0,0 +1,15 @@ |
| 2 | +-- Aggregate rating table for a revision |
| 3 | +CREATE TABLE IF NOT EXISTS /*_*/article_feedback_revisions ( |
| 4 | + -- Foreign key to page.page_id |
| 5 | + afr_page_id integer unsigned NOT NULL, |
| 6 | + -- Revision that totals are relevant to |
| 7 | + afr_revision integer unsigned NOT NULL, |
| 8 | + -- Foreign key to article_feedback_ratings.aar_rating |
| 9 | + afr_rating_id integer unsigned NOT NULL, |
| 10 | + -- Sum (total) of all the ratings for this article revision |
| 11 | + afr_total integer unsigned NOT NULL, |
| 12 | + -- Number of ratings |
| 13 | + afr_count integer unsigned NOT NULL, |
| 14 | + -- One rating row per page |
| 15 | + PRIMARY KEY (afr_page_id, afr_rating_id, afr_revision) |
| 16 | +) /*$wgDBTableOptions*/; |
Property changes on: trunk/extensions/ArticleFeedback/sql/AddRevisionsTable.sql |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 17 | + native |
Index: trunk/extensions/ArticleFeedback/ArticleFeedback.hooks.php |
— | — | @@ -153,6 +153,12 @@ |
154 | 154 | $dir . '/sql/FixPropertiesAnonTokenSchema.sql', |
155 | 155 | true |
156 | 156 | ) ); |
| 157 | + $updater->addExtensionUpdate( array( |
| 158 | + 'addTable', |
| 159 | + 'article_feedback_revisions', |
| 160 | + $dir . '/sql/AddRevisionsTable.sql', |
| 161 | + true |
| 162 | + ) ); |
157 | 163 | } |
158 | 164 | return true; |
159 | 165 | } |