In the morning, the use of composer installed Yii2.0 advanced version, all configuration completed after the discovery of errors in the login, error shows no corresponding user table, and then to the official document on GitHub and looked again, found that the third step has not been implemented, do not know how to do this step, to seek guidance.
Reply content:
In the morning, the use of composer installed Yii2.0 advanced version, all configuration completed after the discovery of errors in the login, error shows no corresponding user table, and then to the official document on GitHub and looked again, found that the third step has not been implemented, do not know how to do this step, to seek guidance.
The third step is to perform a database migration operation, regarding migration-related documents
You set up the database first.
Configuring data information in common/config/main-local.php
Yii is a PHP script that you can run with PHP yii migrate
The migration script under the Console/migrations directory is executed, and the migration is just started. A user table is created
The migration script content is as follows
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 ' = = schema::type_pk, ' username ' = ' sche ' Ma::type_string. ' Not NULL ', ' auth_key ' = schema::type_string. ' (+) not NULL ', ' password_hash ' = = schema::type_string. ' Not NULL ', ' password_reset_token ' + schema::type_string, ' email ' + schema::type_string. ' Not NULL ', ' status ' = = Schema::type_smallint. ' Not NULL DEFAULT ', ' created_at ' and ' = Schema::type_integer. ' Not NULL ', ' updated_at ' = Schema::type_integer. ' Not NULL ',], $tableOptions); The public function is down () {$this->droptable (' {{%user}} '); }}
Based on basic template guessing, you try to do this in the project directory:
./yii migrate
Open cmd, navigate to the project directory, type
yii migrate
If you re-install the YII2, you can directly copy the user table can be generated. The 3rd step is mainly to configure database tables, etc.
Yii Advanced Template Migrate