1
0

Version16000Date20190428150708.php 997 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2019 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\DB\Types;
  11. use OCP\Migration\IOutput;
  12. use OCP\Migration\SimpleMigrationStep;
  13. class Version16000Date20190428150708 extends SimpleMigrationStep {
  14. /**
  15. * @param IOutput $output
  16. * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
  17. * @param array $options
  18. * @return null|ISchemaWrapper
  19. * @throws \Doctrine\DBAL\Schema\SchemaException
  20. */
  21. public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) {
  22. /** @var ISchemaWrapper $schema */
  23. $schema = $schemaClosure();
  24. if ($schema->hasTable('collres_accesscache')) {
  25. $table = $schema->getTable('collres_accesscache');
  26. $table->addColumn('access', Types::BOOLEAN, [
  27. 'notnull' => false,
  28. 'default' => false
  29. ]);
  30. }
  31. return $schema;
  32. }
  33. }