You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Version24000Date20211213081506.php 872B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2021 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. class Version24000Date20211213081506 extends SimpleMigrationStep {
  13. /**
  14. * @param IOutput $output
  15. * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
  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. $hasTable = $schema->hasTable('ratelimit_entries');
  23. if ($hasTable) {
  24. $schema->dropTable('ratelimit_entries');
  25. return $schema;
  26. }
  27. return null;
  28. }
  29. }