Skip to content

Commit

Permalink
Add index for classification attribute
Browse files Browse the repository at this point in the history
Signed-off-by: Akhil <akhil.potukuchi@gmail.com>
  • Loading branch information
akhil1508 committed Nov 28, 2022
1 parent f1b940b commit e6c4d89
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions apps/dav/lib/Migration/Version1025Date20221114151721.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php

declare(strict_types=1);

namespace OCA\DAV\Migration;

use Closure;
use Doctrine\DBAL\Schema\SchemaException;
use OCP\DB\ISchemaWrapper;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;

/**
* Auto-generated migration step: Please modify to your needs!
*/
class Version1025Date20221114151721 extends SimpleMigrationStep {

/**
* @param IOutput $output
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
* @param array $options
*/
public function preSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void {
}

/**
* @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');
$calendarObjectsTable->addIndex(['classification'], 'calendarobject_classification_index');

return $schema;
}

/**
* @param IOutput $output
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
* @param array $options
*/
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void {
}
}

0 comments on commit e6c4d89

Please sign in to comment.