Browse Source
feat: allow to use webhook_listeners without user context
feat: allow to use webhook_listeners without user context
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>pull/46615/head
committed by
Alexander Piskun
No known key found for this signature in database
GPG Key ID: 1F0BF0EC3CF22721
7 changed files with 51 additions and 11 deletions
-
2apps/webhook_listeners/appinfo/info.xml
-
1apps/webhook_listeners/composer/composer/autoload_classmap.php
-
1apps/webhook_listeners/composer/composer/autoload_static.php
-
10apps/webhook_listeners/lib/Controller/WebhooksController.php
-
8apps/webhook_listeners/lib/Db/WebhookListener.php
-
4apps/webhook_listeners/lib/Db/WebhookListenerMapper.php
-
36apps/webhook_listeners/lib/Migration/Version1001Date20240716184935.php
@ -0,0 +1,36 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
|
|||
/** |
|||
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors |
|||
* SPDX-License-Identifier: AGPL-3.0-or-later |
|||
*/ |
|||
|
|||
namespace OCA\WebhookListeners\Migration; |
|||
|
|||
use Closure; |
|||
use OCA\WebhookListeners\Db\WebhookListenerMapper; |
|||
use OCP\DB\ISchemaWrapper; |
|||
use OCP\Migration\IOutput; |
|||
use OCP\Migration\SimpleMigrationStep; |
|||
|
|||
class Version1001Date20240716184935 extends SimpleMigrationStep { |
|||
|
|||
/** |
|||
* @param IOutput $output |
|||
* @param Closure(): ISchemaWrapper $schemaClosure |
|||
* @param array $options |
|||
* @return null|ISchemaWrapper |
|||
*/ |
|||
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { |
|||
$schema = $schemaClosure(); |
|||
|
|||
if ($schema->hasTable(WebhookListenerMapper::TABLE_NAME)) { |
|||
$table = $schema->getTable(WebhookListenerMapper::TABLE_NAME); |
|||
$table->getColumn('user_id')->setNotnull(false)->setDefault(null); |
|||
return $schema; |
|||
} |
|||
return null; |
|||
} |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue