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}}', [ 'id' => $this->primaryKey(), 'username' => $this->string()->notNull()->unique(), 'lastname' => $this->string(), 'firstname' => $this->string(), 'middlename' => $this->string(), 'auth_key' => $this->string(32)->notNull(), 'password_hash' => $this->string()->notNull(), 'password_reset_token' => $this->string()->unique(), 'email' => $this->string()->notNull()->unique(), 'status' => $this->smallInteger()->notNull()->defaultValue(10), 'created_at' => $this->integer()->notNull(), 'updated_at' => $this->integer()->notNull(), ], $tableOptions); $this->insert('{{%user}}', [ 'username' => 'admin', 'lastname' => 'admin', 'firstname' => 'admin', 'middlename' => '', 'auth_key' => 'SlJ315le5enaDJ4OsdvXX83i_drf-JXl', 'password_hash' => '$2y$13$LfYpoaZkKzniNw/7rySAnOVPHy8wKFFznxBVoAWTnbLv/Di0oXqvi', 'password_reset_token' => 'NULL', 'email' => 'admin@admin.com', 'created_at' => '1', 'updated_at' => '1', ]); } public function down() { $this->dropTable('{{%user}}'); } }