Commit 8e8de953 authored by Vincent Petry's avatar Vincent Petry Committed by GitHub

Merge pull request #27536 from owncloud/write-mirgation-output-to-console-for-occ-commands

Use ConsoleOutput in migration occ commands
parents c7a1255b 9851fc5c
...@@ -23,6 +23,7 @@ namespace OC\Core\Command\Db\Migrations; ...@@ -23,6 +23,7 @@ namespace OC\Core\Command\Db\Migrations;
use OC\DB\MigrationService; use OC\DB\MigrationService;
use OC\Migration\ConsoleOutput;
use OCP\IDBConnection; use OCP\IDBConnection;
use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputArgument;
...@@ -57,7 +58,7 @@ class ExecuteCommand extends Command { ...@@ -57,7 +58,7 @@ class ExecuteCommand extends Command {
public function execute(InputInterface $input, OutputInterface $output) { public function execute(InputInterface $input, OutputInterface $output) {
$appName = $input->getArgument('app'); $appName = $input->getArgument('app');
$ms = new MigrationService($appName, $this->connection); $ms = new MigrationService($appName, $this->connection, new ConsoleOutput($output));
$version = $input->getArgument('version'); $version = $input->getArgument('version');
$ms->executeStep($version); $ms->executeStep($version);
......
...@@ -23,6 +23,7 @@ namespace OC\Core\Command\Db\Migrations; ...@@ -23,6 +23,7 @@ namespace OC\Core\Command\Db\Migrations;
use OC\DB\MigrationService; use OC\DB\MigrationService;
use OC\Migration\ConsoleOutput;
use OCP\IConfig; use OCP\IConfig;
use OCP\IDBConnection; use OCP\IDBConnection;
use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Command\Command;
...@@ -113,7 +114,7 @@ class Version<version> implements ISqlMigration { ...@@ -113,7 +114,7 @@ class Version<version> implements ISqlMigration {
public function execute(InputInterface $input, OutputInterface $output) { public function execute(InputInterface $input, OutputInterface $output) {
$appName = $input->getArgument('app'); $appName = $input->getArgument('app');
$ms = new MigrationService($appName, $this->connection); $ms = new MigrationService($appName, $this->connection, new ConsoleOutput($output));
$kind = $input->getArgument('kind'); $kind = $input->getArgument('kind');
$version = date('YmdHis'); $version = date('YmdHis');
......
...@@ -23,6 +23,7 @@ namespace OC\Core\Command\Db\Migrations; ...@@ -23,6 +23,7 @@ namespace OC\Core\Command\Db\Migrations;
use OC\DB\MigrationService; use OC\DB\MigrationService;
use OC\Migration\ConsoleOutput;
use OCP\IDBConnection; use OCP\IDBConnection;
use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputArgument;
...@@ -54,7 +55,7 @@ class MigrateCommand extends Command { ...@@ -54,7 +55,7 @@ class MigrateCommand extends Command {
public function execute(InputInterface $input, OutputInterface $output) { public function execute(InputInterface $input, OutputInterface $output) {
$appName = $input->getArgument('app'); $appName = $input->getArgument('app');
$ms = new MigrationService($appName, $this->connection); $ms = new MigrationService($appName, $this->connection, new ConsoleOutput($output));
$version = $input->getArgument('version'); $version = $input->getArgument('version');
$ms->migrate($version); $ms->migrate($version);
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
namespace OC\Core\Command\Db\Migrations; namespace OC\Core\Command\Db\Migrations;
use OC\DB\MigrationService; use OC\DB\MigrationService;
use OC\Migration\ConsoleOutput;
use OCP\IDBConnection; use OCP\IDBConnection;
use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputArgument;
...@@ -50,7 +51,7 @@ class StatusCommand extends Command { ...@@ -50,7 +51,7 @@ class StatusCommand extends Command {
public function execute(InputInterface $input, OutputInterface $output) { public function execute(InputInterface $input, OutputInterface $output) {
$appName = $input->getArgument('app'); $appName = $input->getArgument('app');
$ms = new MigrationService($appName, $this->connection); $ms = new MigrationService($appName, $this->connection, new ConsoleOutput($output));
$infos = $this->getMigrationsInfos($ms); $infos = $this->getMigrationsInfos($ms);
foreach ($infos as $key => $value) { foreach ($infos as $key => $value) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment