diff options
author | Joas Schilling <coding@schilljs.com> | 2020-03-11 12:29:52 +0100 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2020-03-31 10:51:15 +0200 |
commit | 720dc4e93d83d738861c614745f514cc347ef1f9 (patch) | |
tree | 841e5f1c095df5c24f82f134afac9ddad721a044 /core/Application.php | |
parent | 0faed106d7b0b4868ebcd897469d106d76081800 (diff) | |
download | nextcloud-server-720dc4e93d83d738861c614745f514cc347ef1f9.tar.gz nextcloud-server-720dc4e93d83d738861c614745f514cc347ef1f9.zip |
Add optional column oc_comments.reference_id
Signed-off-by: Joas Schilling <coding@schilljs.com>
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 c2da7f8d194..e4fc33b5402 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); |