1
0

Version18000Date20191204114856.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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\IDBConnection;
  11. use OCP\Migration\IOutput;
  12. use OCP\Migration\SimpleMigrationStep;
  13. class Version18000Date20191204114856 extends SimpleMigrationStep {
  14. public function __construct(
  15. protected IDBConnection $connection,
  16. ) {
  17. }
  18. /**
  19. * @param IOutput $output
  20. * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
  21. * @param array $options
  22. * @return null|ISchemaWrapper
  23. * @throws \Doctrine\DBAL\Schema\SchemaException
  24. */
  25. public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
  26. /** @var ISchemaWrapper $schema */
  27. $schema = $schemaClosure();
  28. $table = $schema->getTable('direct_edit');
  29. $table->addColumn('file_path', 'string', [
  30. 'notnull' => false,
  31. 'length' => 4000,
  32. ]);
  33. return $schema;
  34. }
  35. }