mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-28 10:11:45 +00:00
Merge "persistRevisionThreadItems: Allow processing current revisions only"
This commit is contained in:
commit
7b8d272e7c
|
@ -49,6 +49,7 @@ class PersistRevisionThreadItems extends TableCleanup {
|
|||
$this->addOption( 'rev', 'Revision ID to process', false, true, false, true );
|
||||
$this->addOption( 'page', 'Page title to process', false, true, false, true );
|
||||
$this->addOption( 'all', 'Process the whole wiki', false, false, false, false );
|
||||
$this->addOption( 'current', 'Process current revisions only', false, false, false, false );
|
||||
}
|
||||
|
||||
public function execute() {
|
||||
|
@ -79,6 +80,12 @@ class PersistRevisionThreadItems extends TableCleanup {
|
|||
return;
|
||||
}
|
||||
|
||||
if ( $this->getOption( 'current' ) ) {
|
||||
// runTable() doesn't provide a way to do a JOIN. This is equivalent, but it might have
|
||||
// different performance characteristics. It should be good enough for a maintenance script.
|
||||
$conds[] = 'rev_id IN ( SELECT page_latest FROM page )';
|
||||
}
|
||||
|
||||
$this->runTable( [
|
||||
'table' => 'revision',
|
||||
'conds' => $conds,
|
||||
|
|
Loading…
Reference in a new issue