Version25000Date20220515204012.php 799 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2019 ownCloud GmbH
  4. * SPDX-License-Identifier: AGPL-3.0-only
  5. */
  6. namespace OC\Core\Migrations;
  7. use Closure;
  8. use OCP\DB\ISchemaWrapper;
  9. use OCP\DB\Types;
  10. use OCP\Migration\IOutput;
  11. use OCP\Migration\SimpleMigrationStep;
  12. class Version25000Date20220515204012 extends SimpleMigrationStep {
  13. public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
  14. /** @var ISchemaWrapper $schema */
  15. $schema = $schemaClosure();
  16. if ($schema->hasTable('share')) {
  17. $shareTable = $schema->getTable('share');
  18. if (!$shareTable->hasColumn('attributes')) {
  19. $shareTable->addColumn(
  20. 'attributes',
  21. Types::JSON,
  22. [
  23. 'default' => null,
  24. 'notnull' => false
  25. ]
  26. );
  27. }
  28. }
  29. return $schema;
  30. }
  31. }