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

SetSkuColumnsOptionsToNull::up()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

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