Version24000Date20220202150027.php 990 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. declare(strict_types=1);
  3. namespace OC\Core\Migrations;
  4. use Closure;
  5. use OCP\DB\ISchemaWrapper;
  6. use OCP\DB\Types;
  7. use OCP\Migration\IOutput;
  8. use OCP\Migration\SimpleMigrationStep;
  9. /**
  10. * Auto-generated migration step: Please modify to your needs!
  11. */
  12. class Version24000Date20220202150027 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. $table = $schema->getTable('mounts');
  23. if (!$table->hasColumn('mount_provider_class')) {
  24. $table->addColumn('mount_provider_class', Types::STRING, [
  25. 'notnull' => false,
  26. 'length' => 128,
  27. ]);
  28. $table->addIndex(['mount_provider_class'], 'mounts_class_index');
  29. return $schema;
  30. }
  31. return null;
  32. }
  33. }