Yaron Koren has uploaded a new change for review.
https://gerrit.wikimedia.org/r/278732
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(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo
refs/changes/32/278732/1
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: newchange
Gerrit-Change-Id: I76a5b625dbf235b1f514e39f02350b35b8cd2aed
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits