mirror of
https://github.com/nextcloud/server.git
synced 2025-02-06 01:20:16 +00:00
8af7ecb257
Signed-off-by: Anna Larch <anna@nextcloud.com>
38 lines
1 KiB
PHP
38 lines
1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/**
|
|
* SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
*/
|
|
|
|
namespace OCA\DAV\Migration;
|
|
|
|
use Closure;
|
|
use Doctrine\DBAL\Schema\SchemaException;
|
|
use OCP\DB\ISchemaWrapper;
|
|
use OCP\Migration\IOutput;
|
|
use OCP\Migration\SimpleMigrationStep;
|
|
|
|
class Version1029Date20221114151721 extends SimpleMigrationStep {
|
|
|
|
/**
|
|
* @param IOutput $output
|
|
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
|
|
* @param array $options
|
|
* @return null|ISchemaWrapper
|
|
* @throws SchemaException
|
|
*/
|
|
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
|
|
/** @var ISchemaWrapper $schema */
|
|
$schema = $schemaClosure();
|
|
$calendarObjectsTable = $schema->getTable('calendarobjects');
|
|
if (!$calendarObjectsTable->hasIndex('calobj_clssfction_index')) {
|
|
$calendarObjectsTable->addIndex(['classification'], 'calobj_clssfction_index');
|
|
return $schema;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
}
|