Code Duplication    Length = 18-18 lines in 2 locations

Bootstrap/Update.php 2 locations

@@ 419-436 (lines=18) @@
416
    /**
417
     * Create most used indexes in s_plugin_connect_items table.
418
     */
419
    private function addConnectItemsIndex()
420
    {
421
        if (version_compare($this->version, '1.1.1', '<=')) {
422
            try {
423
                $this->db->query('ALTER TABLE s_plugin_connect_items ADD INDEX stream(shop_id, stream)');
424
                $this->db->query('ALTER TABLE s_plugin_connect_items MODIFY group_id VARCHAR(64)');
425
                $this->db->query('ALTER TABLE s_plugin_connect_items ADD INDEX source_id (source_id, shop_id)');
426
                $this->db->query('ALTER TABLE s_plugin_connect_items ADD INDEX group_id (group_id, shop_id)');
427
            } catch (\Exception $e) {
428
                // ignore it if exists
429
                $this->logger->write(
430
                    true,
431
                    sprintf('An error occurred during update to version %s stacktrace: %s', $this->version, $e->getTraceAsString()),
432
                    $e->getMessage()
433
                );
434
            }
435
        }
436
    }
437
438
    /**
439
     * Create the mapping table between connect remote categories and local categories.
@@ 527-544 (lines=18) @@
524
        }
525
    }
526
527
    private function addShopIdToConnectCategories()
528
    {
529
        if (version_compare($this->version, '1.1.7', '<=')) {
530
            try {
531
                $this->db->query('INSERT INTO `s_plugin_connect_config` (`name`, `value`) VALUES ("addShopIdToConnectCategories", "0")');
532
                $this->db->query('ALTER TABLE s_plugin_connect_categories ADD COLUMN `shop_id` int(11) NULL');
533
                $this->db->query('ALTER TABLE s_plugin_connect_categories DROP INDEX scuk_category_key');
534
                $this->db->query('ALTER TABLE s_plugin_connect_categories ADD UNIQUE KEY `scuk_connect_category_for_shop_id` (`category_key`,`shop_id`)');
535
            } catch (\Exception $e) {
536
                // ignore it if exists
537
                $this->logger->write(
538
                    true,
539
                    sprintf('An error occurred during update to version %s stacktrace: %s', $this->version, $e->getTraceAsString()),
540
                    $e->getMessage()
541
                );
542
            }
543
        }
544
    }
545
546
    private function addArticleRelationsTable()
547
    {