summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2014-02-11 18:01:41 +0100
committerBart Visscher <bartv@thisnet.nl>2014-02-11 18:01:41 +0100
commit3abcd13979660309f9a6d672d3dc64a7c6d784ab (patch)
tree16971a28d01f9f1b9efac53c02c602d50cbd1f48 /core
parenteede20c5acb4135f96f318a4ad0a146dd562861c (diff)
downloadnextcloud-server-3abcd13979660309f9a6d672d3dc64a7c6d784ab.tar.gz
nextcloud-server-3abcd13979660309f9a6d672d3dc64a7c6d784ab.zip
Allow converting from any db type
Diffstat (limited to 'core')
-rw-r--r--core/command/db/converttype.php (renamed from core/command/db/convertfromsqlite.php)15
-rw-r--r--core/register_command.php2
2 files changed, 5 insertions, 12 deletions
diff --git a/core/command/db/convertfromsqlite.php b/core/command/db/converttype.php
index 71706580382..38527d3d55a 100644
--- a/core/command/db/convertfromsqlite.php
+++ b/core/command/db/converttype.php
@@ -15,7 +15,7 @@ use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
-class ConvertFromSqlite extends Command {
+class ConvertType extends Command {
/**
* @var \OC\Config $config
*/
@@ -31,8 +31,8 @@ class ConvertFromSqlite extends Command {
protected function configure() {
$this
- ->setName('db:convert-from-sqlite')
- ->setDescription('Convert the owncloud sqlite database to the newly configured one')
+ ->setName('db:convert-type')
+ ->setDescription('Convert the owncloud database to the newly configured one')
->addArgument(
'type',
InputArgument::REQUIRED,
@@ -82,14 +82,7 @@ class ConvertFromSqlite extends Command {
);
protected function execute(InputInterface $input, OutputInterface $output) {
// connect 'from' database
- $datadir = $this->config->getValue( "datadirectory", \OC::$SERVERROOT.'/data' );
- $name = $this->config->getValue( "dbname", "owncloud" );
- $dbfile = $datadir.'/'.$name.'.db';
- $connectionParams = array(
- 'path' => $dbfile,
- 'driver' => 'pdo_sqlite',
- );
- $fromDB = \Doctrine\DBAL\DriverManager::getConnection($connectionParams);
+ $fromDB = \OC_DB::getConnection();
// connect 'to' database
$type = $input->getArgument('type');
diff --git a/core/register_command.php b/core/register_command.php
index 736953094b1..a3833214c21 100644
--- a/core/register_command.php
+++ b/core/register_command.php
@@ -9,7 +9,7 @@
/** @var $application Symfony\Component\Console\Application */
$application->add(new OC\Core\Command\Status);
$application->add(new OC\Core\Command\Db\GenerateChangeScript());
-$application->add(new OC\Core\Command\Db\ConvertFromSqlite(OC_Config::getObject()));
+$application->add(new OC\Core\Command\Db\ConvertType(OC_Config::getObject()));
$application->add(new OC\Core\Command\Upgrade());
$application->add(new OC\Core\Command\Maintenance\SingleUser());
$application->add(new OC\Core\Command\App\Disable());