mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 00:32:29 -04:00
Don't create cards_abiduri it if already exists
Signed-off-by: Louis Chemineau <louis@chmn.me>
This commit is contained in:
parent
988236b9ae
commit
ed3e37f3c1
1 changed files with 8 additions and 4 deletions
|
|
@ -222,11 +222,15 @@ class AddMissingIndices extends Command {
|
|||
$table = $schema->getTable('cards');
|
||||
|
||||
if ($table->hasIndex('addressbookid_uri_index')) {
|
||||
$output->writeln('<info>Renaming addressbookid_uri_index index to to the cards table, this can take some time...</info>');
|
||||
if ($table->hasIndex('cards_abiduri')) {
|
||||
$table->dropIndex('addressbookid_uri_index');
|
||||
} else {
|
||||
$output->writeln('<info>Renaming addressbookid_uri_index index to cards_abiduri in the cards table, this can take some time...</info>');
|
||||
|
||||
foreach ($table->getIndexes() as $index) {
|
||||
if ($index->getColumns() === ['addressbookid', 'uri']) {
|
||||
$table->renameIndex('addressbookid_uri_index', 'cards_abiduri');
|
||||
foreach ($table->getIndexes() as $index) {
|
||||
if ($index->getColumns() === ['addressbookid', 'uri']) {
|
||||
$table->renameIndex('addressbookid_uri_index', 'cards_abiduri');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue