Add option to populateChangeTagDef not to update the count
authorAmir Sarabadani <ladsgroup@gmail.com>
Mon, 13 Aug 2018 10:44:11 +0000 (12:44 +0200)
committerReedy <reedy@wikimedia.org>
Wed, 15 Aug 2018 14:15:51 +0000 (14:15 +0000)
I need this when I'm picking this up to continue populating

Change-Id: I52c74d3c1c59ee966027d5d9cb1a2bd3cf6dfc7a

maintenance/populateChangeTagDef.php

index 707eb29..b06ac2b 100644 (file)
@@ -38,6 +38,7 @@ class PopulateChangeTagDef extends Maintenance {
                        false,
                        true
                );
                        false,
                        true
                );
+               $this->addOption( 'populate-only', 'Do not update change_tag_def table' );
        }
 
        public function execute() {
        }
 
        public function execute() {
@@ -47,7 +48,9 @@ class PopulateChangeTagDef extends Maintenance {
 
                $this->countDown( 5 );
                if ( $wgChangeTagsSchemaMigrationStage < MIGRATION_NEW ) {
 
                $this->countDown( 5 );
                if ( $wgChangeTagsSchemaMigrationStage < MIGRATION_NEW ) {
-                       $this->updateCountTag();
+                       if ( !$this->hasOption( 'populate-only' ) ) {
+                               $this->updateCountTag();
+                       }
                        $this->backpopulateChangeTagId();
                } else {
                        $this->updateCountTagId();
                        $this->backpopulateChangeTagId();
                } else {
                        $this->updateCountTagId();