summaryrefslogtreecommitdiffstats
path: root/core/command/db
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@owncloud.com>2014-04-15 18:20:36 +0200
committerAndreas Fischer <bantu@owncloud.com>2014-04-15 18:20:36 +0200
commit0a78fb49f560248bac130405dea2b6af9a813d89 (patch)
treecc5cab3e0fdea102e7ec1349f3cc0d8edf474db9 /core/command/db
parentf1d05d204e5ce788ffcfaed04d3c4a06233eb231 (diff)
downloadnextcloud-server-0a78fb49f560248bac130405dea2b6af9a813d89.tar.gz
nextcloud-server-0a78fb49f560248bac130405dea2b6af9a813d89.zip
Pass Connection instead of AbstractSchemaManager to clearSchema().
Diffstat (limited to 'core/command/db')
-rw-r--r--core/command/db/converttype.php13
1 files changed, 5 insertions, 8 deletions
diff --git a/core/command/db/converttype.php b/core/command/db/converttype.php
index 6fcaeacec49..4f3afb949e7 100644
--- a/core/command/db/converttype.php
+++ b/core/command/db/converttype.php
@@ -10,8 +10,6 @@
namespace OC\Core\Command\Db;
-use Doctrine\DBAL\Schema\AbstractSchemaManager;
-
use OC\Config;
use OC\DB\Connection;
use OC\DB\ConnectionFactory;
@@ -156,7 +154,7 @@ class ConvertType extends Command {
$toDB = $this->getToDBConnection($input, $output);
if ($input->getOption('clear-schema')) {
- $this->clearSchema($toDB->getSchemaManager(), $input, $output);
+ $this->clearSchema($toDB, $input, $output);
}
$this->createSchema($toDB, $input, $output);
@@ -214,19 +212,18 @@ class ConvertType extends Command {
return $this->connectionFactory->getConnection($type, $connectionParams);
}
- protected function clearSchema(AbstractSchemaManager $schemaManager, InputInterface $input, OutputInterface $output) {
- $toTables = $schemaManager->listTableNames();
+ protected function clearSchema(Connection $db, InputInterface $input, OutputInterface $output) {
+ $toTables = $this->getTables($db);
if (!empty($toTables)) {
$output->writeln('<info>Clearing schema in new database</info>');
}
foreach($toTables as $table) {
- $schemaManager->dropTable($table);
+ $db->getSchemaManager()->dropTable($table);
}
}
protected function getTables(Connection $db) {
- $schemaManager = $db->getSchemaManager();
- return $schemaManager->listTableNames();
+ return $db->getSchemaManager()->listTableNames();
}
protected function copyTable(Connection $fromDB, Connection $toDB, $table, InputInterface $input, OutputInterface $output) {