aboutsummaryrefslogtreecommitdiffstats
path: root/core/Migrations/Version21000Date20210309185127.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/Migrations/Version21000Date20210309185127.php')
-rw-r--r--core/Migrations/Version21000Date20210309185127.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/core/Migrations/Version21000Date20210309185127.php b/core/Migrations/Version21000Date20210309185127.php
new file mode 100644
index 00000000000..35efc1e5ab7
--- /dev/null
+++ b/core/Migrations/Version21000Date20210309185127.php
@@ -0,0 +1,35 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+namespace OC\Core\Migrations;
+
+use Closure;
+use OCP\DB\ISchemaWrapper;
+use OCP\Migration\IOutput;
+use OCP\Migration\SimpleMigrationStep;
+
+class Version21000Date20210309185127 extends SimpleMigrationStep {
+ /**
+ * @param IOutput $output
+ * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
+ * @param array $options
+ * @return null|ISchemaWrapper
+ */
+ public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
+ /** @var ISchemaWrapper $schema */
+ $schema = $schemaClosure();
+
+ $table = $schema->getTable('known_users');
+ if (!$table->hasIndex('ku_known_user')) {
+ $table->addIndex(['known_user'], 'ku_known_user');
+ return $schema;
+ }
+
+ return null;
+ }
+}