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

UpdateCartIndexes::up()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 10
rs 9.4285
c 1
b 0
f 0
cc 3
eloc 6
nc 4
nop 2
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