<?php

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

class m151013_154204_add__table__user__account_assignment extends Migration
{
    public function up()
    {
    	$tableOptions = null;
    	if ($this->db->driverName === 'mysql') {
    		// http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci
    		$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
    	}
    	
    	$this->createTable('{{%user_account_assignment}}', [
    			'id_user_account_assignment' => $this->primaryKey(),
    			'id_user' =>  $this->integer(11) ,
    			'id_account' =>  $this->integer(11) ,
    	], $tableOptions);
    }

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

        return false;
    }

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

    public function safeDown()
    {
    }
    */
}
