Completed
Push — 1.9 ( 9955b8...d085a6 )
by
unknown
11:29
created

SetSkuColumnsOptionsToNull   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A up() 0 12 1
1
<?php
2
3
namespace OroCRM\Bundle\MagentoBundle\Migrations\Schema\v1_41_1;
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 SetSkuColumnsOptionsToNull implements Migration
11
{
12
    /**
13
     * {@inheritdoc}
14
     */
15
    public function up(Schema $schema, QueryBag $queries)
16
    {
17
        $table = $schema->getTable('orocrm_magento_cart_item');
18
        $table->getColumn('sku')->setOptions(['notnull' => false]);
19
20
        $table = $schema->getTable('orocrm_magento_order_items');
21
        $table->getColumn('sku')->setOptions(['notnull' => false]);
22
23
        $table = $schema->getTable('orocrm_magento_product');
24
        $table->getColumn('sku')->setOptions(['notnull' => false]);
25
        $table->dropIndex('unq_sku_channel_id');
26
    }
27
}
28