Completed
Push — 1.10 ( 3bcec0...1a0641 )
by
unknown
08:47
created

UpdateCartIndexes   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 16
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A up() 0 10 3
1
<?php
2
3
namespace OroCRM\Bundle\MagentoBundle\Migrations\Schema\v1_41_3;
4
5
use Doctrine\DBAL\Schema\Schema;
6
7
use Oro\Bundle\MigrationBundle\Migration\Migration;
8
use Oro\Bundle\MigrationBundle\Migration\QueryBag;
9
10
class UpdateCartIndexes implements Migration
11
{
12
    /**
13
     * {@inheritdoc}
14
     */
15
    public function up(Schema $schema, QueryBag $queries)
16
    {
17
        $table = $schema->getTable('orocrm_magento_cart');
18
        if (!$table->hasIndex('magecart_payment_details_idx')) {
19
            $table->addIndex(['payment_details'], 'magecart_payment_details_idx', []);
20
        }
21
        if (!$table->hasIndex('status_name_items_qty_idx')) {
22
            $table->addIndex(['status_name', 'items_qty'], 'status_name_items_qty_idx', []);
23
        }
24
    }
25
}
26