Version1030Date20240205103243.php 888 B

12345678910111213141516171819202122232425262728293031323334353637
  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\DAV\Migration;
  8. use Closure;
  9. use OCP\DB\ISchemaWrapper;
  10. use OCP\Migration\IOutput;
  11. use OCP\Migration\SimpleMigrationStep;
  12. class Version1030Date20240205103243 extends SimpleMigrationStep {
  13. /**
  14. * @param IOutput $output
  15. * @param Closure(): ISchemaWrapper $schemaClosure
  16. * @param array $options
  17. * @return null|ISchemaWrapper
  18. */
  19. public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
  20. /** @var ISchemaWrapper $schema */
  21. $schema = $schemaClosure();
  22. $tableCards = $schema->getTable('cards');
  23. if ($tableCards->hasIndex('cards_abiduri') && $tableCards->hasIndex('cards_abid')) {
  24. $tableCards->dropIndex('cards_abid');
  25. }
  26. return $schema;
  27. }
  28. }