r85964 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85963‎ | r85964 | r85965 >
Date:17:58, 13 April 2011
Author:catrope
Status:ok
Tags:
Comment:
ArticleFeedback: Revert most of r84535, removing aap_revision again. This will break AFT for anyone that ran it from trunk in the past 3 weeks or so, but it never worked right to begin with.

A per-revision aggregate table was added in r85962. The API files aren't updated for this change yet, because reverting r84535 probably wouldn't merge cleanly. We'll sort that out later today.
Modified paths:
  • /trunk/extensions/ArticleFeedback/ArticleFeedback.hooks.php (modified) (history)
  • /trunk/extensions/ArticleFeedback/sql/AddPageRevisionColumn.sql (deleted) (history)
  • /trunk/extensions/ArticleFeedback/sql/ArticleFeedback.sql (modified) (history)

Diff [purge]

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 @@
3535 -- 1 vote per user per revision
3636 PRIMARY KEY (aa_revision, aa_user_text, aa_rating_id, aa_user_anon_token)
3737 ) /*$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);
4039
4140 -- Aggregate rating table for a page
4241 CREATE TABLE IF NOT EXISTS /*_*/article_feedback_pages (
4342 -- Foreign key to page.page_id
4443 aap_page_id integer unsigned NOT NULL,
45 - -- Revision that totals are relevant to
46 - aap_revision integer unsigned NOT NULL,
4744 -- Foreign key to article_feedback_ratings.aar_rating
4845 aap_rating_id integer unsigned NOT NULL,
4946 -- Sum (total) of all the ratings for this article revision
@@ -50,7 +47,7 @@
5148 -- Number of ratings
5249 aap_count integer unsigned NOT NULL,
5350 -- 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)
5552 ) /*$wgDBTableOptions*/;
5653
5754 -- Aggregate rating table for a revision
@@ -76,6 +73,7 @@
7774 afp_revision integer unsigned NOT NULL,
7875 afp_user_text varbinary(255) NOT NULL,
7976 afp_user_anon_token varbinary(32) NOT NULL DEFAULT '',
 77+
8078 -- Key/value pairs
8179 afp_key varbinary(255) NOT NULL,
8280 -- Integer value
@@ -83,5 +81,4 @@
8482 -- Text value
8583 afp_value_text varbinary(255) DEFAULT '' NOT NULL
8684 ) /*$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 @@
138138 true
139139 ) );
140140 }
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 - }
150141 $updater->addExtensionUpdate( array(
151142 'addTable',
152143 'article_feedback_properties',
@@ -165,7 +156,7 @@
166157 }
167158 return true;
168159 }
169 -
 160+
170161 /**
171162 * ParserTestTables hook
172163 */

Follow-up revisions

RevisionCommit summaryAuthorDate
r85974ArticleFeedback: Rename insertPageRating() to insertRevisionRating() and rein...catrope18:46, 13 April 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r84535Step 2 of 2 for implementing expirations....tparscal17:18, 22 March 2011
r85962Added article_feedback_revisions table.tparscal17:56, 13 April 2011

Status & tagging log