Index: trunk/phase3/maintenance/migrateUserGroup.php |
— | — | @@ -35,10 +35,10 @@ |
36 | 36 | $count = 0;
|
37 | 37 | $oldGroup = $this->getArg( 0 );
|
38 | 38 | $newGroup = $this->getArg( 1 );
|
39 | | - $dbr = wfGetDB( DB_SLAVE );
|
40 | | - $start = $dbr->selectField( 'user_groups', 'MIN(ug_user)',
|
| 39 | + $dbw = wfGetDB( DB_MASTER );
|
| 40 | + $start = $dbw->selectField( 'user_groups', 'MIN(ug_user)',
|
41 | 41 | array('ug_group' => $oldGroup), __FUNCTION__ );
|
42 | | - $end = $dbr->selectField( 'user_groups', 'MAX(ug_user)',
|
| 42 | + $end = $dbw->selectField( 'user_groups', 'MAX(ug_user)',
|
43 | 43 | array('ug_group' => $oldGroup), __FUNCTION__ );
|
44 | 44 | if( $start === null ) {
|
45 | 45 | $this->error( "Nothing to do - no users in the '$oldGroup' group", true );
|
— | — | @@ -48,7 +48,6 @@ |
49 | 49 | $blockStart = $start;
|
50 | 50 | $blockEnd = $start + $this->mBatchSize - 1;
|
51 | 51 | // Migrate users over in batches...
|
52 | | - $dbw = wfGetDB( DB_MASTER );
|
53 | 52 | while( $blockEnd <= $end ) {
|
54 | 53 | $this->output( "Doing users $blockStart to $blockEnd\n" );
|
55 | 54 | $dbw->begin();
|