setBatchSize( 500 ); $this->requireExtension( 'Echo' ); } public function getUpdateKey() { return __CLASS__; } public function doDBUpdates() { global $wgEchoCluster; $reader = new BatchRowIterator( MWEchoDbFactory::getDB( DB_SLAVE ), $this->table, $this->idField, $this->mBatchSize ); $reader->addConditions( [ "event_page_title IS NOT NULL", "event_page_id" => null, ] ); $reader->setFetchColumns( [ 'event_page_namespace', 'event_page_title', 'event_extra', 'event_type' ] ); $updater = new BatchRowUpdate( $reader, new BatchRowWriter( MWEchoDbFactory::getDB( DB_MASTER ), $this->table, $wgEchoCluster ), new EchoSuppressionRowUpdateGenerator ); $updater->setOutput( function ( $text ) { $this->output( $text ); } ); $updater->execute(); return true; } } $maintClass = 'UpdateEchoSchemaForSuppression'; // Tells it to run the class require_once RUN_MAINTENANCE_IF_MAIN;