<?php

use yii\db\Schema;
use yii\db\Migration;

class m160104_155510_alter__table__transaction__add__column__paid_by extends Migration
{
    public function up()
    {
    	$this->addColumn("transfer", "paid_by",  "int");
    	$this->execute("update transfer set paid_by = id_user where paid_at is not null");
    }

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

        return false;
    }

    /*
    // Use safeUp/safeDown to run migration code within a transaction
    public function safeUp()
    {
    }

    public function safeDown()
    {
    }
    */
}
