summaryrefslogtreecommitdiffstats
path: root/core/Command
diff options
context:
space:
mode:
authorBjoern Schiessle <bjoern@schiessle.org>2017-12-15 10:45:00 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2017-12-18 21:14:45 +0100
commit41ee23a0543bac873b03f1a8e45178f9ec0a4075 (patch)
treef27b10826ef4fbace0e7d6cac6e721ac52d8656b /core/Command
parentde9858142141f3fdc80ed443e59ef9ef11fce02c (diff)
downloadnextcloud-server-41ee23a0543bac873b03f1a8e45178f9ec0a4075.tar.gz
nextcloud-server-41ee23a0543bac873b03f1a8e45178f9ec0a4075.zip
make occ command more generic
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'core/Command')
-rw-r--r--core/Command/Db/AddMissingIndices.php (renamed from core/Command/Db/AddIndexToShareTable.php)32
1 files changed, 25 insertions, 7 deletions
diff --git a/core/Command/Db/AddIndexToShareTable.php b/core/Command/Db/AddMissingIndices.php
index cfd5c1871b2..314bed8ccb1 100644
--- a/core/Command/Db/AddIndexToShareTable.php
+++ b/core/Command/Db/AddMissingIndices.php
@@ -28,7 +28,15 @@ use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
-class AddIndexToShareTable extends Command {
+/**
+ * Class AddMissingIndices
+ *
+ * if you added any new indices to the database, this is the right place to add
+ * it your update routine for existing instances
+ *
+ * @package OC\Core\Command\Db
+ */
+class AddMissingIndices extends Command {
/** @var IDBConnection */
private $connection;
@@ -43,11 +51,24 @@ class AddIndexToShareTable extends Command {
protected function configure() {
$this
- ->setName('db:add-index-to-share-table')
- ->setDescription('Add a index to share_with at the share table to increase performance');
+ ->setName('db:add-missing-indices')
+ ->setDescription('Add missing indices to the database tables');
}
protected function execute(InputInterface $input, OutputInterface $output) {
+ $this->addShareTableIndicies($output);
+
+ }
+
+ /**
+ * add missing indices to the share table
+ *
+ * @param OutputInterface $output
+ * @throws \Doctrine\DBAL\Schema\SchemaException
+ */
+ private function addShareTableIndicies(OutputInterface $output) {
+
+ $output->writeln('<info>Check indices of the share table.</info>');
$schema = new SchemaWrapper($this->connection);
$updated = false;
@@ -64,10 +85,7 @@ class AddIndexToShareTable extends Command {
}
if (!$updated) {
- $output->writeln('<info>All index already existed, nothing to do.</info>');
+ $output->writeln('<info>Done.</info>');
}
-
- return 0;
-
}
}