diff options
author | Joas Schilling <213943+nickvergessen@users.noreply.github.com> | 2020-04-02 11:34:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-02 11:34:21 +0200 |
commit | bc6a5ef5c4431ca662424dbd1125e65e74b27fa8 (patch) | |
tree | a4ca41650699b5d9f9356eb4e7d5a5a10ab15ab2 /core/Application.php | |
parent | c1368b86963b93a42ec98a856f8d307d922c8967 (diff) | |
parent | 1f5ba56235349ad811329b80cc1a2338dc8c79c7 (diff) | |
download | nextcloud-server-bc6a5ef5c4431ca662424dbd1125e65e74b27fa8.tar.gz nextcloud-server-bc6a5ef5c4431ca662424dbd1125e65e74b27fa8.zip |
Merge pull request #19890 from nextcloud/enh/comments-reference-id
Add optional comments reference_id
Diffstat (limited to 'core/Application.php')
-rw-r--r-- | core/Application.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/core/Application.php b/core/Application.php index c1ac8971532..15246c9c76c 100644 --- a/core/Application.php +++ b/core/Application.php @@ -39,6 +39,7 @@ use OC\Authentication\Listeners\RemoteWipeNotificationsListener; use OC\Authentication\Listeners\UserDeletedStoreCleanupListener; use OC\Authentication\Notifications\Notifier as AuthenticationNotifier; use OC\Core\Notification\RemoveLinkSharesNotifier; +use OC\DB\MissingColumnInformation; use OC\DB\MissingIndexInformation; use OC\DB\SchemaWrapper; use OCP\AppFramework\App; @@ -167,6 +168,23 @@ class Application extends App { } ); + $eventDispatcher->addListener(IDBConnection::CHECK_MISSING_COLUMNS_EVENT, + function (GenericEvent $event) use ($container) { + /** @var MissingColumnInformation $subject */ + $subject = $event->getSubject(); + + $schema = new SchemaWrapper($container->query(IDBConnection::class)); + + if ($schema->hasTable('comments')) { + $table = $schema->getTable('comments'); + + if (!$table->hasColumn('reference_id')) { + $subject->addHintForMissingColumn($table->getName(), 'reference_id'); + } + } + } + ); + $eventDispatcher->addServiceListener(RemoteWipeStarted::class, RemoteWipeActivityListener::class); $eventDispatcher->addServiceListener(RemoteWipeStarted::class, RemoteWipeNotificationsListener::class); $eventDispatcher->addServiceListener(RemoteWipeStarted::class, RemoteWipeEmailListener::class); |