Index: trunk/extensions/FlaggedRevs/maintenance/updateStats.inc |
— | — | @@ -224,6 +224,15 @@ |
225 | 225 | $dbCache->set( $key, $data, 30*24*3600 ); |
226 | 226 | // Save the data |
227 | 227 | $dbw = wfGetDB( DB_MASTER ); |
| 228 | + |
| 229 | + // Make sure the master has flaggedrevs_stats and _stats2 |
| 230 | + if( !$dbw->tableExists( 'flaggedrevs_stats' ) || |
| 231 | + !$dbw->tableExists( 'flaggedrevs_stats2' ) ) |
| 232 | + { |
| 233 | + print( "Need to run update.php to create flaggedrevs_stats and flaggedrevs_stats2. Stopping." ); |
| 234 | + die( 1 ); |
| 235 | + } |
| 236 | + |
228 | 237 | $dbw->begin(); |
229 | 238 | // Create small stats tables if not present |
230 | 239 | $flaggedrevs_stats = $dbr->tableName('flaggedrevs_stats'); |
— | — | @@ -268,27 +277,3 @@ |
269 | 278 | $dbCache->delete( $keySQL ); |
270 | 279 | print( "done updating!\n" ); |
271 | 280 | } |
272 | | - |
273 | | -// Per-Namespace stats |
274 | | -function createFlaggedRevsStatsTable( $dbw, $flaggedrevs_stats ) { |
275 | | - $dbw->query( |
276 | | - "CREATE TABLE $flaggedrevs_stats ( |
277 | | - namespace INTEGER UNSIGNED NOT NULL DEFAULT 0 PRIMARY KEY, |
278 | | - total INTEGER UNSIGNED NOT NULL DEFAULT 0, |
279 | | - reviewed INTEGER UNSIGNED NOT NULL DEFAULT 0, |
280 | | - synced INTEGER UNSIGNED NOT NULL DEFAULT 0 |
281 | | - );" |
282 | | - ); |
283 | | -} |
284 | | - |
285 | | -// General stats |
286 | | -function createFlaggedRevsStatsTable2( $dbw, $flaggedrevs_stats2 ) { |
287 | | - $dbw->query( |
288 | | - "CREATE TABLE $flaggedrevs_stats2 ( |
289 | | - stat_id INTEGER UNSIGNED NOT NULL DEFAULT 1 PRIMARY KEY, |
290 | | - ave_review_time INTEGER UNSIGNED NOT NULL DEFAULT 0, |
291 | | - med_review_time INTEGER UNSIGNED NOT NULL DEFAULT 0, |
292 | | - ave_pending_time INTEGER UNSIGNED NOT NULL DEFAULT 0 |
293 | | - );" |
294 | | - ); |
295 | | -} |
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.sql |
— | — | @@ -136,3 +136,17 @@ |
137 | 137 | frp_user_id integer unsigned NOT NULL PRIMARY KEY, |
138 | 138 | frp_user_params mediumblob NOT NULL |
139 | 139 | ) /*$wgDBTableOptions*/; |
| 140 | + |
| 141 | +CREATE TABLE /*_*/flaggedrevs_stats ( |
| 142 | + namespace int unsigned NOT NULL DEFAULT 0 PRIMARY KEY, |
| 143 | + total int unsigend NOT NULL DEFAULT 0, |
| 144 | + reviewed int unsigned NOT NULL DEFAULT 0, |
| 145 | + synced int unsigned NOT NULL DEFAULT 0 |
| 146 | +) /*$wgDBTableOptions*/; |
| 147 | + |
| 148 | +CREATE TABLE /*_*/flaggedrevs_stats2 ( |
| 149 | + stat_id int unsigned NOT NULL DEFAULT 1 PRIMARY KEY, |
| 150 | + ave_review_time int unsigned NOT NULL DEFAULT 0, |
| 151 | + med_review_time int unsigned NOT NULL DEFAULT 0, |
| 152 | + ave_pending_time int unsigned NOT NULL DEFAULT 0 |
| 153 | +) /*$wgDBTableOptions*/; |
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php |
— | — | @@ -2203,6 +2203,8 @@ |
2204 | 2204 | "$base/archives/patch-fpc_level.sql" ); |
2205 | 2205 | $wgExtNewTables[] = array( 'flaggedpage_pending', |
2206 | 2206 | "$base/archives/patch-flaggedpage_pending.sql" ); |
| 2207 | + $wgExtNewTables[] = array( 'flaggedrevs_stats', |
| 2208 | + "$base/archives/patch-flaggedrevs_stats.sql" ); |
2207 | 2209 | } elseif ( $wgDBtype == 'postgres' ) { |
2208 | 2210 | // Initial install tables (current schema) |
2209 | 2211 | $wgExtNewTables[] = array( 'flaggedrevs', "$base/FlaggedRevs.pg.sql" ); |
Index: trunk/extensions/FlaggedRevs/archives/patch-flaggedrevs_stats.sql |
— | — | @@ -0,0 +1,14 @@ |
| 2 | +-- Various statistics about the reviewed namespaces |
| 3 | +CREATE TABLE /*_*/flaggedrevs_stats ( |
| 4 | + namespace int unsigned NOT NULL DEFAULT 0 PRIMARY KEY, |
| 5 | + total int unsigend NOT NULL DEFAULT 0, |
| 6 | + reviewed int unsigned NOT NULL DEFAULT 0, |
| 7 | + synced int unsigned NOT NULL DEFAULT 0 |
| 8 | +) /*$wgDBTableOptions*/; |
| 9 | + |
| 10 | +CREATE TABLE /*_*/flaggedrevs_stats2 ( |
| 11 | + stat_id int unsigned NOT NULL DEFAULT 1 PRIMARY KEY, |
| 12 | + ave_review_time int unsigned NOT NULL DEFAULT 0, |
| 13 | + med_review_time int unsigned NOT NULL DEFAULT 0, |
| 14 | + ave_pending_time int unsigned NOT NULL DEFAULT 0 |
| 15 | +) /*$wgDBTableOptions*/; |
Property changes on: trunk/extensions/FlaggedRevs/archives/patch-flaggedrevs_stats.sql |
___________________________________________________________________ |
Name: svn:eol-style |
1 | 16 | + native |