r94802 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r94801‎ | r94802 | r94803 >
Date:19:40, 17 August 2011
Author:reedy
Status:resolved (Comments)
Tags:
Comment:
Bug 30426 - Complicated database schema update procedure will make enabling AF on a new wiki (that can't use update.php) a PITA
Modified paths:
  • /trunk/extensions/ArticleFeedback/sql/ArticleFeedback.sql (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleFeedback/sql/ArticleFeedback.sql
@@ -32,10 +32,13 @@
3333 aa_rating_value int unsigned NOT NULL,
3434 -- Which rating widget the user was given. Default of 0 is the "old" design
3535 aa_design_bucket int unsigned NOT NULL DEFAULT 0,
 36+ aa_design_bucket int unsigned NOT NULL DEFAULT 0,
3637 -- 1 vote per user per revision
3738 PRIMARY KEY (aa_revision, aa_user_text, aa_rating_id, aa_user_anon_token)
3839 ) /*$wgDBTableOptions*/;
3940 CREATE INDEX /*i*/aa_user_page_revision ON /*_*/article_feedback (aa_user_id, aa_page_id, aa_revision);
 41+-- Create an index on the article_feedback.aa_timestamp field
 42+CREATE INDEX /*i*/article_feedback_timestamp ON /*_*/article_feedback (aa_timestamp);
4043
4144 -- Aggregate rating table for a page
4245 CREATE TABLE IF NOT EXISTS /*_*/article_feedback_pages (
@@ -83,3 +86,26 @@
8487 afp_value_text varbinary(255) DEFAULT '' NOT NULL
8588 ) /*$wgDBTableOptions*/;
8689 CREATE UNIQUE INDEX /*i*/afp_rating_key ON /*_*/article_feedback_properties (afp_revision, afp_user_text, afp_user_anon_token, afp_key);
 90+
 91+CREATE TABLE IF NOT EXISTS /*_*/article_feedback_stats (
 92+ afs_page_id integer unsigned NOT NULL,
 93+ -- data point to be used for ordering this data
 94+ afs_orderable_data double unsigned NOT NULL,
 95+ -- json object of stat data
 96+ afs_data varbinary(255) NOT NULL,
 97+ afs_stats_type_id integer unsigned NOT NULL,
 98+ -- timestamp of insertion job
 99+ afs_ts binary(14) NOT NULL
 100+) /*$wgDBTableOptions*/;
 101+CREATE UNIQUE INDEX /*i*/afs_type_ts_page ON /*_*/article_feedback_stats(afs_stats_type_id, afs_ts, afs_page_id);
 102+CREATE INDEX /*i*/ afs_type_ts_orderable ON /*_*/article_feedback_stats (afs_stats_type_id, afs_ts, afs_orderable_data);
 103+
 104+CREATE TABLE IF NOT EXISTS /*_*/article_feedback_stats_types (
 105+ afst_id integer unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
 106+ afst_type varbinary(255) NOT NULL
 107+) /*$wgDBTableOptions*/;
 108+CREATE UNIQUE INDEX /*i*/afst_type ON /*_*/article_feedback_stats_types( afst_type );
 109+
 110+-- Pre-populate table with stat types
 111+INSERT INTO article_feedback_stats_types ( afst_type ) VALUES ( 'highs_and_lows' );
 112+INSERT INTO article_feedback_stats_types ( afst_type ) VALUES ( 'problems' );

Follow-up revisions

RevisionCommit summaryAuthorDate
r94803Fix copy paste fail from r94802 per Myra...reedy19:45, 17 August 2011
r94804Merge r94802, r94803 to make creation easierreedy19:50, 17 August 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r94799Severely simplify the ArticleFeedback updater hook...reedy19:27, 17 August 2011

Comments

#Comment by MZMcBride (talk | contribs)   19:43, 17 August 2011
34	  aa_design_bucket int unsigned NOT NULL DEFAULT 0,
35	  aa_design_bucket int unsigned NOT NULL DEFAULT 0,

This seems wrong. ;-)

Status & tagging log