Index: trunk/extensions/Contest/Contest.hooks.php |
— | — | @@ -33,122 +33,6 @@ |
34 | 34 | ) ); |
35 | 35 | |
36 | 36 | $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( |
153 | 37 | 'addField', |
154 | 38 | 'contests', |
155 | 39 | '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 @@ |
19 | 19 | |
20 | 20 | contest_submission_count SMALLINT unsigned NOT NULL-- Amount of submissions made to the contest |
21 | 21 | ) /*$wgDBTableOptions*/; |
| 22 | +CREATE UNIQUE INDEX /*i*/contest_name ON /*_*/contests (contest_name); |
| 23 | +CREATE INDEX /*i*/contest_status ON /*_*/contests (contest_status, contest_end); |
22 | 24 | |
23 | 25 | -- Contestants |
24 | 26 | CREATE TABLE IF NOT EXISTS /*_*/contest_contestants ( |
— | — | @@ -43,6 +45,9 @@ |
44 | 46 | contestant_rating_count SMALLINT unsigned NOT NULL, -- The amount of ratings |
45 | 47 | contestant_comments SMALLINT unsigned NOT NULL -- The amount of comments |
46 | 48 | ) /*$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); |
47 | 52 | |
48 | 53 | -- Challenges |
49 | 54 | CREATE TABLE IF NOT EXISTS /*_*/contest_challenges ( |
— | — | @@ -53,6 +58,8 @@ |
54 | 59 | challenge_title VARCHAR(255) NOT NULL, -- Title of the challenge |
55 | 60 | challenge_oneline TEXT NOT NULL -- One line description of the challenge |
56 | 61 | ) /*$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); |
57 | 64 | |
58 | 65 | -- Judge votes |
59 | 66 | CREATE TABLE IF NOT EXISTS /*_*/contest_votes ( |
— | — | @@ -62,6 +69,9 @@ |
63 | 70 | |
64 | 71 | vote_value SMALLINT NOT NULL -- The value of the vote |
65 | 72 | ) /*$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); |
66 | 76 | |
67 | 77 | -- Judge comments |
68 | 78 | CREATE TABLE IF NOT EXISTS /*_*/contest_comments ( |
— | — | @@ -71,4 +81,5 @@ |
72 | 82 | |
73 | 83 | comment_text TEXT NOT NULL, -- The comment text |
74 | 84 | 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 |