<?php

use yii\db\Migration;

class m160324_114404_orders_items_items_fk extends Migration
{
    public function up()
    {

        $this->dropForeignKey('orders_items_items_fk', '{{%order_items}}');
        $this->addForeignKey('orders_items_items_fk', '{{%order_items}}', 'item_id', '{{%product_variant}}', 'product_variant_id', 'RESTRICT', 'RESTRICT');
    }

    public function down()
    {
        $this->dropForeignKey('orders_items_items_fk', '{{%order_items}}');
        $this->addForeignKey('orders_items_items_fk', '{{%order_items}}', 'item_id', '{{%product}}', 'product_id', 'RESTRICT', 'RESTRICT');

    }

}
