From 6cddb366549e3dfc3da47a66390e64628e9abeda Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Wed, 27 Nov 2024 10:24:30 -0100 Subject: [PATCH] migration attributes Signed-off-by: Maxence Lange --- lib/Migration/Version0031Date20241105133904.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Migration/Version0031Date20241105133904.php b/lib/Migration/Version0031Date20241105133904.php index 54d68e4a3..98030854e 100644 --- a/lib/Migration/Version0031Date20241105133904.php +++ b/lib/Migration/Version0031Date20241105133904.php @@ -14,10 +14,13 @@ use Closure; use Doctrine\DBAL\Schema\SchemaException; use OCP\DB\ISchemaWrapper; +use OCP\Migration\Attributes\AddIndex; +use OCP\Migration\Attributes\IndexType; use OCP\Migration\IOutput; use OCP\Migration\SimpleMigrationStep; use Psr\Log\LoggerInterface; +#[AddIndex('circles_mountpoint', IndexType::UNIQUE, 'add uniqueness to mountpoint per user')] class Version0031Date20241105133904 extends SimpleMigrationStep { public function __construct( private LoggerInterface $logger, @@ -30,7 +33,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt try { $table = $schema->getTable('circles_mountpoint'); - if (!$table->hasIndex('dname')) { + if (!$table->hasIndex('mp_sid_hash')) { $table->addUniqueIndex(['single_id', 'mountpoint_hash'], 'mp_sid_hash'); } } catch (SchemaException $e) {