Version30000Date20240717111406.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OC\Core\Migrations;
  8. use Closure;
  9. use OCP\DB\ISchemaWrapper;
  10. use OCP\DB\Types;
  11. use OCP\Migration\IOutput;
  12. use OCP\Migration\SimpleMigrationStep;
  13. /**
  14. *
  15. */
  16. class Version30000Date20240717111406 extends SimpleMigrationStep {
  17. /**
  18. * @param IOutput $output
  19. * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
  20. * @param array $options
  21. * @return null|ISchemaWrapper
  22. */
  23. public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
  24. /** @var ISchemaWrapper $schema */
  25. $schema = $schemaClosure();
  26. if ($schema->hasTable('taskprocessing_tasks')) {
  27. $table = $schema->getTable('taskprocessing_tasks');
  28. $table->addColumn('webhook_uri', Types::STRING, [
  29. 'notnull' => false,
  30. 'default' => null,
  31. 'length' => 4000,
  32. ]);
  33. $table->addColumn('webhook_method', Types::STRING, [
  34. 'notnull' => false,
  35. 'default' => null,
  36. 'length' => 64,
  37. ]);
  38. return $schema;
  39. }
  40. return null;
  41. }
  42. }