Version1020Date20240403003535.php 863 B

123456789101112131415161718192021222324252627282930313233343536373839
  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 OCA\Files_Trashbin\Migration;
  8. use Closure;
  9. use OCP\DB\ISchemaWrapper;
  10. use OCP\DB\Types;
  11. use OCP\Migration\IOutput;
  12. use OCP\Migration\SimpleMigrationStep;
  13. class Version1020Date20240403003535 extends SimpleMigrationStep {
  14. /**
  15. * @param Closure(): ISchemaWrapper $schemaClosure
  16. */
  17. public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
  18. /** @var ISchemaWrapper $schema */
  19. $schema = $schemaClosure();
  20. if (!$schema->hasTable('files_trash')) {
  21. return null;
  22. }
  23. $table = $schema->getTable('files_trash');
  24. $table->addColumn('deleted_by', Types::STRING, [
  25. 'notnull' => false,
  26. 'length' => 64,
  27. ]);
  28. return $schema;
  29. }
  30. }