Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2020-04-02 12:34:21 +0300
committerGitHub <noreply@github.com>2020-04-02 12:34:21 +0300
commitbc6a5ef5c4431ca662424dbd1125e65e74b27fa8 (patch)
treea4ca41650699b5d9f9356eb4e7d5a5a10ab15ab2 /core/Application.php
parentc1368b86963b93a42ec98a856f8d307d922c8967 (diff)
parent1f5ba56235349ad811329b80cc1a2338dc8c79c7 (diff)
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.php18
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);