Version24000Date20220404230027.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-only
  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. /**
  14. * Add oc_file_metadata table
  15. * @see \OC\Metadata\FileMetadata
  16. */
  17. class Version24000Date20220404230027 extends SimpleMigrationStep {
  18. /**
  19. * @param IOutput $output
  20. * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
  21. * @param array $options
  22. * @return null|ISchemaWrapper
  23. */
  24. public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
  25. // /** @var ISchemaWrapper $schema */
  26. // $schema = $schemaClosure();
  27. // if (!$schema->hasTable('file_metadata')) {
  28. // $table = $schema->createTable('file_metadata');
  29. // $table->addColumn('id', Types::BIGINT, [
  30. // 'notnull' => true,
  31. // ]);
  32. // $table->addColumn('group_name', Types::STRING, [
  33. // 'notnull' => true,
  34. // 'length' => 50,
  35. // ]);
  36. // $table->addColumn('value', Types::TEXT, [
  37. // 'notnull' => false,
  38. // 'default' => '',
  39. // ]);
  40. // $table->setPrimaryKey(['id', 'group_name'], 'file_metadata_idx');
  41. // return $schema;
  42. // }
  43. return null;
  44. }
  45. }