m210602_172731_add.php 714 Bytes
<?php

use yii\db\Migration;

/**
 * Class m210602_172731_add
 */
class m210602_172731_add extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        // creates index for column `author_id`
        $this->createIndex(
            'idx-host-status',
            '{{%host}}',
            'wis_status'
        );

        $this->addColumn('{{%host}}', 'domain_expire', $this->dateTime()->null()->comment('Дата действия'));
    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
        $this->dropIndex(
            'idx-host-status',
            '{{%host}}'
        );

        $this->dropColumn('{{%host}}', 'domain_expire');

    }

}