r99530 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99529‎ | r99530 | r99531 >
Date:18:40, 11 October 2011
Author:catrope
Status:ok
Tags:
Comment:
Move all index creations to the main SQL file, and remove unnecessary updater invocations
Modified paths:
  • /trunk/extensions/Contest/Contest.hooks.php (modified) (history)
  • /trunk/extensions/Contest/Contest.sql (modified) (history)
  • /trunk/extensions/Contest/sql/IndexChallengeContestId.sql (deleted) (history)
  • /trunk/extensions/Contest/sql/IndexChallengeTitle.sql (deleted) (history)
  • /trunk/extensions/Contest/sql/IndexCommentTime.sql (deleted) (history)
  • /trunk/extensions/Contest/sql/IndexContestName.sql (deleted) (history)
  • /trunk/extensions/Contest/sql/IndexContestStatus.sql (deleted) (history)
  • /trunk/extensions/Contest/sql/IndexContestantInterests.sql (deleted) (history)
  • /trunk/extensions/Contest/sql/IndexContestantRating.sql (deleted) (history)
  • /trunk/extensions/Contest/sql/IndexContestantUserContest.sql (deleted) (history)
  • /trunk/extensions/Contest/sql/IndexVoteContestantId.sql (deleted) (history)
  • /trunk/extensions/Contest/sql/IndexVoteContestantUser.sql (deleted) (history)
  • /trunk/extensions/Contest/sql/IndexVoteUserId.sql (deleted) (history)

Diff [purge]

Index: trunk/extensions/Contest/Contest.hooks.php
@@ -33,122 +33,6 @@
3434 ) );
3535
3636 $updater->addExtensionUpdate( array(
37 - 'addTable',
38 - 'contest_contestants',
39 - dirname( __FILE__ ) . '/Contest.sql',
40 - true
41 - ) );
42 -
43 - $updater->addExtensionUpdate( array(
44 - 'addTable',
45 - 'contest_challenges',
46 - dirname( __FILE__ ) . '/Contest.sql',
47 - true
48 - ) );
49 -
50 - $updater->addExtensionUpdate( array(
51 - 'addTable',
52 - 'contest_votes',
53 - dirname( __FILE__ ) . '/Contest.sql',
54 - true
55 - ) );
56 -
57 - $updater->addExtensionUpdate( array(
58 - 'addTable',
59 - 'contest_comments',
60 - dirname( __FILE__ ) . '/Contest.sql',
61 - true
62 - ) );
63 -
64 - $updater->addExtensionUpdate( array(
65 - 'addIndex',
66 - 'contests',
67 - 'contest_name',
68 - dirname( __FILE__ ) . '/sql/IndexContestName.sql',
69 - true
70 - ) );
71 -
72 - $updater->addExtensionUpdate( array(
73 - 'addIndex',
74 - 'contest_contestants',
75 - 'contestant_user_contest',
76 - dirname( __FILE__ ) . '/sql/IndexContestantUserContest.sql',
77 - true
78 - ) );
79 -
80 - $updater->addExtensionUpdate( array(
81 - 'addIndex',
82 - 'contest_challenges',
83 - 'challenge_contest_id',
84 - dirname( __FILE__ ) . '/sql/IndexChallengeContestId.sql',
85 - true
86 - ) );
87 -
88 - $updater->addExtensionUpdate( array(
89 - 'addIndex',
90 - 'contest_challenges',
91 - 'challenge_title',
92 - dirname( __FILE__ ) . '/sql/IndexChallengeTitle.sql',
93 - true
94 - ) );
95 -
96 - $updater->addExtensionUpdate( array(
97 - 'addIndex',
98 - 'contest_comments',
99 - 'comment_time',
100 - dirname( __FILE__ ) . '/sql/IndexCommentTime.sql',
101 - true
102 - ) );
103 -
104 - $updater->addExtensionUpdate( array(
105 - 'addIndex',
106 - 'contest_contestants',
107 - 'contestant_interests',
108 - dirname( __FILE__ ) . '/sql/IndexContestantInterests.sql',
109 - true
110 - ) );
111 -
112 - $updater->addExtensionUpdate( array(
113 - 'addIndex',
114 - 'contest_contestants',
115 - 'contestant_rating',
116 - dirname( __FILE__ ) . '/sql/IndexContestantRating.sql',
117 - true
118 - ) );
119 -
120 - $updater->addExtensionUpdate( array(
121 - 'addIndex',
122 - 'contests',
123 - 'contest_status',
124 - dirname( __FILE__ ) . '/sql/IndexContestStatus.sql',
125 - true
126 - ) );
127 -
128 - $updater->addExtensionUpdate( array(
129 - 'addIndex',
130 - 'contest_votes',
131 - 'vote_contestant_id',
132 - dirname( __FILE__ ) . '/sql/IndexVoteContestantId.sql',
133 - true
134 - ) );
135 -
136 - $updater->addExtensionUpdate( array(
137 - 'addIndex',
138 - 'contest_votes',
139 - 'vote_contestant_user',
140 - dirname( __FILE__ ) . '/sql/IndexVoteContestantUser.sql',
141 - true
142 - ) );
143 -
144 - $updater->addExtensionUpdate( array(
145 - 'addIndex',
146 - 'contest_votes',
147 - 'vote_user_id',
148 - dirname( __FILE__ ) . '/sql/IndexVoteUserId.sql',
149 - true
150 - ) );
151 -
152 - $updater->addExtensionUpdate( array(
15337 'addField',
15438 'contests',
15539 'contest_signup_email',
Index: trunk/extensions/Contest/sql/IndexVoteUserId.sql
@@ -1 +0,0 @@
2 -CREATE INDEX /*i*/vote_user_id ON /*_*/contest_votes (vote_user_id);
\ No newline at end of file
Index: trunk/extensions/Contest/sql/IndexVoteContestantId.sql
@@ -1 +0,0 @@
2 -CREATE INDEX /*i*/vote_contestant_id ON /*_*/contest_votes (vote_contestant_id);
\ No newline at end of file
Index: trunk/extensions/Contest/sql/IndexChallengeContestId.sql
@@ -1 +0,0 @@
2 -CREATE INDEX /*i*/challenge_contest_id ON /*_*/contest_challenges (challenge_contest_id);
\ No newline at end of file
Index: trunk/extensions/Contest/sql/IndexVoteContestantUser.sql
@@ -1 +0,0 @@
2 -CREATE UNIQUE INDEX /*i*/vote_contestant_user ON /*_*/contest_votes (vote_contestant_id, vote_user_id);
\ No newline at end of file
Index: trunk/extensions/Contest/sql/IndexContestName.sql
@@ -1 +0,0 @@
2 -CREATE UNIQUE INDEX /*i*/contest_name ON /*_*/contests (contest_name);
\ No newline at end of file
Index: trunk/extensions/Contest/sql/IndexCommentTime.sql
@@ -1 +0,0 @@
2 -CREATE INDEX /*i*/comment_time ON /*_*/contest_comments (comment_contestant_id, comment_time);
\ No newline at end of file
Index: trunk/extensions/Contest/sql/IndexContestantUserContest.sql
@@ -1 +0,0 @@
2 -CREATE UNIQUE INDEX /*i*/contestant_user_contest ON /*_*/contest_contestants (contestant_contest_id, contestant_user_id);
\ No newline at end of file
Index: trunk/extensions/Contest/sql/IndexContestStatus.sql
@@ -1 +0,0 @@
2 -CREATE INDEX /*i*/contest_status ON /*_*/contests (contest_status, contest_end);
\ No newline at end of file
Index: trunk/extensions/Contest/sql/IndexContestantInterests.sql
@@ -1 +0,0 @@
2 -CREATE INDEX /*i*/contestant_interests ON /*_*/contest_contestants (contestant_challenge_id, contestant_wmf, contestant_volunteer);
\ No newline at end of file
Index: trunk/extensions/Contest/sql/IndexChallengeTitle.sql
@@ -1 +0,0 @@
2 -CREATE UNIQUE INDEX /*i*/challenge_title ON /*_*/contest_challenges (challenge_title);
\ No newline at end of file
Index: trunk/extensions/Contest/sql/IndexContestantRating.sql
@@ -1 +0,0 @@
2 -CREATE INDEX /*i*/contestant_rating ON /*_*/contest_contestants (contestant_challenge_id, contestant_rating, contestant_rating_count);
\ No newline at end of file
Index: trunk/extensions/Contest/Contest.sql
@@ -18,6 +18,8 @@
1919
2020 contest_submission_count SMALLINT unsigned NOT NULL-- Amount of submissions made to the contest
2121 ) /*$wgDBTableOptions*/;
 22+CREATE UNIQUE INDEX /*i*/contest_name ON /*_*/contests (contest_name);
 23+CREATE INDEX /*i*/contest_status ON /*_*/contests (contest_status, contest_end);
2224
2325 -- Contestants
2426 CREATE TABLE IF NOT EXISTS /*_*/contest_contestants (
@@ -43,6 +45,9 @@
4446 contestant_rating_count SMALLINT unsigned NOT NULL, -- The amount of ratings
4547 contestant_comments SMALLINT unsigned NOT NULL -- The amount of comments
4648 ) /*$wgDBTableOptions*/;
 49+CREATE INDEX /*i*/contestant_interests ON /*_*/contest_contestants (contestant_challenge_id, contestant_wmf, contestant_volunteer);
 50+CREATE INDEX /*i*/contestant_rating ON /*_*/contest_contestants (contestant_challenge_id, contestant_rating, contestant_rating_count);
 51+CREATE UNIQUE INDEX /*i*/contestant_user_contest ON /*_*/contest_contestants (contestant_contest_id, contestant_user_id);
4752
4853 -- Challenges
4954 CREATE TABLE IF NOT EXISTS /*_*/contest_challenges (
@@ -53,6 +58,8 @@
5459 challenge_title VARCHAR(255) NOT NULL, -- Title of the challenge
5560 challenge_oneline TEXT NOT NULL -- One line description of the challenge
5661 ) /*$wgDBTableOptions*/;
 62+CREATE INDEX /*i*/challenge_contest_id ON /*_*/contest_challenges (challenge_contest_id);
 63+CREATE UNIQUE INDEX /*i*/challenge_title ON /*_*/contest_challenges (challenge_title);
5764
5865 -- Judge votes
5966 CREATE TABLE IF NOT EXISTS /*_*/contest_votes (
@@ -62,6 +69,9 @@
6370
6471 vote_value SMALLINT NOT NULL -- The value of the vote
6572 ) /*$wgDBTableOptions*/;
 73+CREATE INDEX /*i*/vote_contestant_id ON /*_*/contest_votes (vote_contestant_id);
 74+CREATE UNIQUE INDEX /*i*/vote_contestant_user ON /*_*/contest_votes (vote_contestant_id, vote_user_id);
 75+CREATE INDEX /*i*/vote_user_id ON /*_*/contest_votes (vote_user_id);
6676
6777 -- Judge comments
6878 CREATE TABLE IF NOT EXISTS /*_*/contest_comments (
@@ -71,4 +81,5 @@
7282
7383 comment_text TEXT NOT NULL, -- The comment text
7484 comment_time varbinary(14) NOT NULL default '' -- The time at which the comment was made
75 -) /*$wgDBTableOptions*/;
\ No newline at end of file
 85+) /*$wgDBTableOptions*/;
 86+CREATE INDEX /*i*/comment_time ON /*_*/contest_comments (comment_contestant_id, comment_time);
\ No newline at end of file

Status & tagging log