|
| 1 | +<?php |
| 2 | + |
| 3 | +declare(strict_types=1); |
| 4 | + |
| 5 | +namespace OCA\DAV\Migration; |
| 6 | + |
| 7 | +use Closure; |
| 8 | +use Doctrine\DBAL\Schema\SchemaException; |
| 9 | +use OCP\DB\ISchemaWrapper; |
| 10 | +use OCP\Migration\IOutput; |
| 11 | +use OCP\Migration\SimpleMigrationStep; |
| 12 | + |
| 13 | +/** |
| 14 | + * Auto-generated migration step: Please modify to your needs! |
| 15 | + */ |
| 16 | +class Version1025Date20221114151721 extends SimpleMigrationStep { |
| 17 | + |
| 18 | + /** |
| 19 | + * @param IOutput $output |
| 20 | + * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
| 21 | + * @param array $options |
| 22 | + */ |
| 23 | + public function preSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void { |
| 24 | + } |
| 25 | + |
| 26 | + /** |
| 27 | + * @param IOutput $output |
| 28 | + * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
| 29 | + * @param array $options |
| 30 | + * @return null|ISchemaWrapper |
| 31 | + * @throws SchemaException |
| 32 | + */ |
| 33 | + public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { |
| 34 | + /** @var ISchemaWrapper $schema */ |
| 35 | + $schema = $schemaClosure(); |
| 36 | + $calendarObjectsTable = $schema->getTable('calendarobjects'); |
| 37 | + $calendarObjectsTable->addIndex(['classification'], 'calendarobject_classification_index'); |
| 38 | + |
| 39 | + return $schema; |
| 40 | + } |
| 41 | + |
| 42 | + /** |
| 43 | + * @param IOutput $output |
| 44 | + * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
| 45 | + * @param array $options |
| 46 | + */ |
| 47 | + public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void { |
| 48 | + } |
| 49 | +} |
0 commit comments