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