for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use yii\db\Migration;
/**
* Handles the creation of table `{{%user}}`.
*/
class m200717_082932_create_user_table extends Migration
{
* {@inheritdoc}
public function safeUp()
$this->createTable('{{%user}}', [
'id' => $this->primaryKey(),
'username' => $this->string(60)->notNull()->unique(),
'avatar' => $this->string()->defaultValue(''),
'email' => $this->string(120)->notNull()->unique(),
'auth_key' => $this->string()->notNull(),
'password_hash' => $this->string()->notNull(),
'password_reset_token' => $this->string()->defaultValue(''),
'status' => $this->tinyInteger()->defaultValue(0),
'base_currency_code' => $this->string(3)->notNull(),
'created_at' => $this->timestamp()->defaultValue(null),
'updated_at' => $this->timestamp()->defaultValue(null),
]);
}
public function safeDown()
$this->dropTable('{{%user}}');