1
0

Version1130Date20220110154719.php 944 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCA\User_LDAP\Migration;
  8. use Closure;
  9. use OCP\DB\ISchemaWrapper;
  10. use OCP\Migration\IOutput;
  11. use OCP\Migration\SimpleMigrationStep;
  12. class Version1130Date20220110154719 extends SimpleMigrationStep {
  13. public function getName() {
  14. return 'Drop ldap_group_mapping_backup';
  15. }
  16. /**
  17. * @param IOutput $output
  18. * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
  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. if ($schema->hasTable('ldap_group_mapping_backup')) {
  26. $schema->dropTable('ldap_group_mapping_backup');
  27. return $schema;
  28. }
  29. return null;
  30. }
  31. }