File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -222,11 +222,15 @@ private function addCoreIndexes(OutputInterface $output) {
222222 $ table = $ schema ->getTable ('cards ' );
223223
224224 if ($ table ->hasIndex ('addressbookid_uri_index ' )) {
225- $ output ->writeln ('<info>Renaming addressbookid_uri_index index to to the cards table, this can take some time...</info> ' );
226-
227- foreach ($ table ->getIndexes () as $ index ) {
228- if ($ index ->getColumns () === ['addressbookid ' , 'uri ' ]) {
229- $ table ->renameIndex ('addressbookid_uri_index ' , 'cards_abiduri ' );
225+ if ($ table ->hasIndex ('cards_abiduri ' )) {
226+ $ table ->dropIndex ('addressbookid_uri_index ' );
227+ } else {
228+ $ output ->writeln ('<info>Renaming addressbookid_uri_index index to to the cards table, this can take some time...</info> ' );
229+
230+ foreach ($ table ->getIndexes () as $ index ) {
231+ if ($ index ->getColumns () === ['addressbookid ' , 'uri ' ]) {
232+ $ table ->renameIndex ('addressbookid_uri_index ' , 'cards_abiduri ' );
233+ }
230234 }
231235 }
232236
You can’t perform that action at this time.
0 commit comments