common/migrations/db/m160203_095604_user_token.php
<?php
/*
* This file is part of the HomeFinanceV2 project.
*
* (c) Rafalsky.com <http://github.com/Rafalsky/>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use yii\db\Migration;
class m160203_095604_user_token extends Migration
{
public function up()
{
$this->createTable('{{%user_token}}', [
'id' => $this->primaryKey(),
'user_id' => $this->integer()->notNull(),
'type' => $this->string()->notNull(),
'token' => $this->string(40)->notNull(),
'expire_at' => $this->integer(),
'created_at' => $this->integer(),
'updated_at' => $this->integer()
]);
}
public function down()
{
$this->dropTable('{{%user_token}}');
}
}