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) {