Skip to content

Commit

Permalink
migration attributes
Browse files Browse the repository at this point in the history
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
  • Loading branch information
ArtificialOwl committed Nov 27, 2024
1 parent afe31b6 commit 6cddb36
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/Migration/Version0031Date20241105133904.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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) {
Expand Down

0 comments on commit 6cddb36

Please sign in to comment.