Yaron Koren has submitted this change and it was merged.

Change subject: Added "delete" option for setCargoPageData.php
......................................................................


Added "delete" option for setCargoPageData.php

Change-Id: I76a5b625dbf235b1f514e39f02350b35b8cd2aed
---
M maintenance/setCargoPageData.php
1 file changed, 12 insertions(+), 1 deletion(-)

Approvals:
  Yaron Koren: Checked; Looks good to me, approved
  jenkins-bot: Verified



diff --git a/maintenance/setCargoPageData.php b/maintenance/setCargoPageData.php
index 31ad4f1..eebf5b3 100644
--- a/maintenance/setCargoPageData.php
+++ b/maintenance/setCargoPageData.php
@@ -5,7 +5,7 @@
  * auxiliary tables) for all pages in the wiki.
  *
  * Usage:
- *  no parameters
+ *  php setCargoPageData.php --delete
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -36,6 +36,8 @@
                parent::__construct();
 
                $this->mDescription = "Stores a set of data each page in the 
wiki in one or more database tables, for use within Cargo queries.";
+
+               $this->addOption( "delete", "Delete the page data DB table(s)", 
false, false );
        }
 
        public function execute() {
@@ -52,6 +54,15 @@
                        CargoDeleteCargoTable::deleteTable( '_pageData', 
$fieldTables );
                }
 
+               if ( $this->getOption( "delete" ) ) {
+                       if ( $numRows > 0 ) {
+                               $this->output( "\n Deleted page data 
table(s).\n" );
+                       } else {
+                               $this->output( "\n No page data tables found; 
exiting.\n" );
+                       }
+                       return;
+               }
+
                $tableSchema = CargoPageData::getTableSchema();
                $tableSchemaString = $tableSchema->toDBString();
 

-- 
To view, visit https://gerrit.wikimedia.org/r/278732
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I76a5b625dbf235b1f514e39f02350b35b8cd2aed
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren <[email protected]>
Gerrit-Reviewer: Yaron Koren <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to