From 65fc2fa02d119859e8ba38f1e8a98fb85184f511 Mon Sep 17 00:00:00 2001 From: binsky Date: Wed, 11 Aug 2021 12:19:11 +0200 Subject: [PATCH] add migration to create an index for label in the credentials table Signed-off-by: binsky --- .../Version020308Date20210805164128.php | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 lib/Migration/Version020308Date20210805164128.php diff --git a/lib/Migration/Version020308Date20210805164128.php b/lib/Migration/Version020308Date20210805164128.php new file mode 100644 index 00000000..7baf486d --- /dev/null +++ b/lib/Migration/Version020308Date20210805164128.php @@ -0,0 +1,57 @@ +hasTable('passman_credentials')) { + $table = $schema->getTable('passman_credentials'); + if (!$table->hasIndex('passman_credential_label_index')) { + $table->changeColumn('label', [ + 'type' => Type::getType('string'), + 'length' => 300 + ]); + $table->addIndex(['label'], 'passman_credential_label_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 { + } +}