1
0

Version29000Date20240131122720.php 944 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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\Migration\IOutput;
  11. use OCP\Migration\SimpleMigrationStep;
  12. /**
  13. *
  14. */
  15. class Version29000Date20240131122720 extends SimpleMigrationStep {
  16. /**
  17. * @param IOutput $output
  18. * @param Closure(): ISchemaWrapper $schemaClosure
  19. * @param array $options
  20. * @return null|ISchemaWrapper
  21. */
  22. public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
  23. /** @var ISchemaWrapper $schema */
  24. $schema = $schemaClosure();
  25. $tableProperties = $schema->getTable('properties');
  26. if ($tableProperties->hasIndex('property_index') &&
  27. $tableProperties->hasIndex('properties_path_index')) {
  28. $tableProperties->dropIndex('property_index');
  29. }
  30. return $schema;
  31. }
  32. }