|
|
@@ -0,0 +1,28 @@ |
|
|
|
<?php |
|
|
|
|
|
|
|
use yii\db\Migration; |
|
|
|
use yii\db\Schema; |
|
|
|
|
|
|
|
/** |
|
|
|
* Class m240704_071250_create_foreign_keys_product_accessory |
|
|
|
*/ |
|
|
|
class m240704_071250_create_foreign_keys_product_accessory extends Migration |
|
|
|
{ |
|
|
|
/** |
|
|
|
* {@inheritdoc} |
|
|
|
*/ |
|
|
|
public function safeUp() |
|
|
|
{ |
|
|
|
$this->addForeignKey('product_accessory_fk_id_product', 'product_accessory', 'id_product', 'product', 'id'); |
|
|
|
$this->addForeignKey('product_accessory_fk_id_accessory', 'product_accessory', 'id_accessory', 'accessory', 'id'); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* {@inheritdoc} |
|
|
|
*/ |
|
|
|
public function safeDown() |
|
|
|
{ |
|
|
|
$this->dropForeignKey('product_accessory_fk_id_product', 'product_accessory'); |
|
|
|
$this->dropForeignKey('product_accessory_fk_id_accessory', 'product_accessory'); |
|
|
|
} |
|
|
|
} |