m180613_144215_alter_table_comment.php 793 Bytes
<?php

use yii\db\Migration;

/**
 * Class m180613_144215_alter_table_comment
 */
class m180613_144215_alter_table_comment extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        $this->addColumn('comment', 'status', $this->boolean());
        $this->addColumn('comment', 'created_at', $this->integer());
    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
       $this->dropColumn('comment', 'status');
       $this->dropColumn('comment', 'created_at');
    }

    /*
    // Use up()/down() to run migration code without a transaction.
    public function up()
    {

    }

    public function down()
    {
        echo "m180613_144215_alter_table_comment cannot be reverted.\n";

        return false;
    }
    */
}