Skip to content

Commit

Permalink
Add hasIndex check
Browse files Browse the repository at this point in the history
Signed-off-by: Akhil <akhil.potukuchi@gmail.com>
  • Loading branch information
akhil1508 committed Nov 29, 2022
1 parent 7ac164c commit b08e885
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions apps/dav/lib/Migration/Version1025Date20221114151721.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();
$calendarObjectsTable = $schema->getTable('calendarobjects');
$calendarObjectsTable->addIndex(['classification'], 'calobj_clssfction_index');

if(!$calendarObjectsTable->hasIndex('calobj_clssfction_index')) {
$calendarObjectsTable->addIndex(['classification'], 'calobj_clssfction_index');
}
return $schema;
}

Expand Down

0 comments on commit b08e885

Please sign in to comment.