<?php

use yii\db\Migration;

/**
 * Class m240508_093106_create_indexes_performance
 */
class m240508_093106_create_indexes_performance extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        $this->createIndex('id_user', 'user_producer', 'id_user');
        $this->createIndex('id_producer', 'user_producer', 'id_producer');
        $this->createIndex('id_product', 'product_price', 'id_product');
        $this->createIndex('status', 'user', 'status');
        $this->createIndex('email', 'user', 'email');
        $this->createIndex('type', 'user', 'type');
        $this->createIndex('id_producer', 'user', 'id_producer');
        $this->createIndex('date', 'distribution', 'date');
        $this->createIndex('id_producer', 'distribution', 'id_producer');
    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
        $this->dropIndex('id_user', 'user_producer');
        $this->dropIndex('id_producer', 'user_producer');
        $this->dropIndex('id_product', 'product_prices');
        $this->dropIndex('status', 'user');
        $this->dropIndex('email', 'user');
        $this->dropIndex('type', 'user');
        $this->dropIndex('id_producer', 'user');
        $this->dropIndex('date', 'distribution');
        $this->dropIndex('id_producer', 'distribution');
    }
}
