Skip to content

Commit a856cbc

Browse files
committed
Add hasIndex check
1 parent 1d38939 commit a856cbc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

apps/dav/lib/Migration/Version1025Date20221114151721.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
2323
/** @var ISchemaWrapper $schema */
2424
$schema = $schemaClosure();
2525
$calendarObjectsTable = $schema->getTable('calendarobjects');
26-
$calendarObjectsTable->addIndex(['classification'], 'calobj_clssfction_index');
27-
26+
if(!$calendarObjectsTable->hasIndex('calobj_clssfction_index')) {
27+
$calendarObjectsTable->addIndex(['classification'], 'calobj_clssfction_index');
28+
}
2829
return $schema;
2930
}
3031

0 commit comments

Comments
 (0)