Index: trunk/extensions/ArticleFeedback/sql/ArticleFeedback.sql |
— | — | @@ -53,6 +53,22 @@ |
54 | 54 | PRIMARY KEY (aap_page_id, aap_rating_id, aap_revision) |
55 | 55 | ) /*$wgDBTableOptions*/; |
56 | 56 | |
| 57 | +-- Aggregate rating table for a revision |
| 58 | +CREATE TABLE IF NOT EXISTS /*_*/article_feedback_revisions ( |
| 59 | + -- Foreign key to page.page_id |
| 60 | + afr_page_id integer unsigned NOT NULL, |
| 61 | + -- Revision that totals are relevant to |
| 62 | + afr_revision integer unsigned NOT NULL, |
| 63 | + -- Foreign key to article_feedback_ratings.aar_rating |
| 64 | + afr_rating_id integer unsigned NOT NULL, |
| 65 | + -- Sum (total) of all the ratings for this article revision |
| 66 | + afr_total integer unsigned NOT NULL, |
| 67 | + -- Number of ratings |
| 68 | + afr_count integer unsigned NOT NULL, |
| 69 | + -- One rating row per page |
| 70 | + PRIMARY KEY (afr_page_id, afr_rating_id, afr_revision) |
| 71 | +) /*$wgDBTableOptions*/; |
| 72 | + |
57 | 73 | -- Properties table for meta information |
58 | 74 | CREATE TABLE IF NOT EXISTS /*_*/article_feedback_properties ( |
59 | 75 | -- Keys to the primary key fields in article_feedback, except aa_rating_id |