aboutsummaryrefslogtreecommitdiffstats
path: root/core/Command
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2023-07-20 00:05:59 +0200
committerJoas Schilling <coding@schilljs.com>2023-07-24 14:51:35 +0200
commitab70bbd3ffbc3788035588c86984f9508db8edbe (patch)
tree9c154ea7911ce285da58a45df5e9ace41d255b20 /core/Command
parent86310a35b25d22ff81aa6ca4ee0c52c769e3d359 (diff)
downloadnextcloud-server-ab70bbd3ffbc3788035588c86984f9508db8edbe.tar.gz
nextcloud-server-ab70bbd3ffbc3788035588c86984f9508db8edbe.zip
fix(db)!: Remove private legacy event because we can not keep it
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'core/Command')
-rw-r--r--core/Command/Db/AddMissingColumns.php8
-rw-r--r--core/Command/Db/AddMissingIndices.php12
-rw-r--r--core/Command/Db/AddMissingPrimaryKeys.php9
3 files changed, 2 insertions, 27 deletions
diff --git a/core/Command/Db/AddMissingColumns.php b/core/Command/Db/AddMissingColumns.php
index 46642f7d0d4..07763c66154 100644
--- a/core/Command/Db/AddMissingColumns.php
+++ b/core/Command/Db/AddMissingColumns.php
@@ -29,15 +29,11 @@ namespace OC\Core\Command\Db;
use OC\DB\Connection;
use OC\DB\SchemaWrapper;
use OCP\DB\Events\AddMissingColumnsEvent;
-use OCP\DB\Types;
use OCP\EventDispatcher\IEventDispatcher;
-use OCP\IDBConnection;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\EventDispatcher\EventDispatcherInterface;
-use Symfony\Component\EventDispatcher\GenericEvent;
/**
* Class AddMissingColumns
@@ -50,7 +46,6 @@ use Symfony\Component\EventDispatcher\GenericEvent;
class AddMissingColumns extends Command {
public function __construct(
private Connection $connection,
- private EventDispatcherInterface $legacyDispatcher,
private IEventDispatcher $dispatcher,
) {
parent::__construct();
@@ -67,9 +62,6 @@ class AddMissingColumns extends Command {
$dryRun = $input->getOption('dry-run');
// Dispatch event so apps can also update columns if needed
- $event = new GenericEvent($output);
- $this->legacyDispatcher->dispatch(IDBConnection::ADD_MISSING_COLUMNS_EVENT, $event);
-
$event = new AddMissingColumnsEvent();
$this->dispatcher->dispatchTyped($event);
$missingColumns = $event->getMissingColumns();
diff --git a/core/Command/Db/AddMissingIndices.php b/core/Command/Db/AddMissingIndices.php
index f05be314e08..56dbf8ce8d9 100644
--- a/core/Command/Db/AddMissingIndices.php
+++ b/core/Command/Db/AddMissingIndices.php
@@ -33,18 +33,14 @@ declare(strict_types=1);
*/
namespace OC\Core\Command\Db;
-use Doctrine\DBAL\Platforms\PostgreSQL94Platform;
use OC\DB\Connection;
use OC\DB\SchemaWrapper;
use OCP\DB\Events\AddMissingIndicesEvent;
use OCP\EventDispatcher\IEventDispatcher;
-use OCP\IDBConnection;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\EventDispatcher\EventDispatcherInterface;
-use Symfony\Component\EventDispatcher\GenericEvent;
/**
* Class AddMissingIndices
@@ -57,8 +53,7 @@ use Symfony\Component\EventDispatcher\GenericEvent;
class AddMissingIndices extends Command {
public function __construct(
private Connection $connection,
- private IEventDispatcher $eventDispatcher,
- private EventDispatcherInterface $dispatcher,
+ private IEventDispatcher $dispatcher,
) {
parent::__construct();
}
@@ -74,11 +69,8 @@ class AddMissingIndices extends Command {
$dryRun = $input->getOption('dry-run');
// Dispatch event so apps can also update indexes if needed
- $event = new GenericEvent($output);
- $this->dispatcher->dispatch(IDBConnection::ADD_MISSING_INDEXES_EVENT, $event);
-
$event = new AddMissingIndicesEvent();
- $this->eventDispatcher->dispatchTyped($event);
+ $this->dispatcher->dispatchTyped($event);
$missingIndices = $event->getMissingIndices();
if ($missingIndices !== []) {
diff --git a/core/Command/Db/AddMissingPrimaryKeys.php b/core/Command/Db/AddMissingPrimaryKeys.php
index b7435144933..658eb0b0f5a 100644
--- a/core/Command/Db/AddMissingPrimaryKeys.php
+++ b/core/Command/Db/AddMissingPrimaryKeys.php
@@ -28,17 +28,12 @@ namespace OC\Core\Command\Db;
use OC\DB\Connection;
use OC\DB\SchemaWrapper;
-use OCP\DB\Events\AddMissingColumnsEvent;
use OCP\DB\Events\AddMissingPrimaryKeyEvent;
use OCP\EventDispatcher\IEventDispatcher;
-use OCP\IDBConnection;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\EventDispatcher\EventDispatcherInterface;
-use Symfony\Component\EventDispatcher\GenericEvent;
-use function Symfony\Component\Translation\t;
/**
* Class AddMissingPrimaryKeys
@@ -51,7 +46,6 @@ use function Symfony\Component\Translation\t;
class AddMissingPrimaryKeys extends Command {
public function __construct(
private Connection $connection,
- private EventDispatcherInterface $legacyDispatcher,
private IEventDispatcher $dispatcher,
) {
parent::__construct();
@@ -68,9 +62,6 @@ class AddMissingPrimaryKeys extends Command {
$dryRun = $input->getOption('dry-run');
// Dispatch event so apps can also update indexes if needed
- $event = new GenericEvent($output);
- $this->legacyDispatcher->dispatch(IDBConnection::ADD_MISSING_PRIMARY_KEYS_EVENT, $event);
-
$event = new AddMissingPrimaryKeyEvent();
$this->dispatcher->dispatchTyped($event);
$missingKeys = $event->getMissingPrimaryKeys();