File tree Expand file tree Collapse file tree 4 files changed +30
-5
lines changed Expand file tree Collapse file tree 4 files changed +30
-5
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ use app \components \Migration ;
4+
5+ class m161109_112016_rename_user_table extends Migration
6+ {
7+ public function up ()
8+ {
9+ $ this ->renameTable ('{{%User}} ' , '{{%user}} ' );
10+ }
11+
12+ public function down ()
13+ {
14+ $ this ->renameTable ('{{%user}} ' , '{{%User}} ' );
15+ }
16+
17+ /*
18+ // Use safeUp/safeDown to run migration code within a transaction
19+ public function safeUp()
20+ {
21+ }
22+
23+ public function safeDown()
24+ {
25+ }
26+ */
27+ }
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ class BaseUserModel extends ActiveRecord implements IdentityInterface
4040 */
4141 public static function tableName ()
4242 {
43- return '{{%User }} ' ;
43+ return '{{%user }} ' ;
4444 }
4545
4646 /**
Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ protected function setupTestDbData()
106106
107107 // Structure :
108108
109- $ db ->createCommand ()->createTable ('User ' , [
109+ $ db ->createCommand ()->createTable ('user ' , [
110110 'id ' => 'pk ' ,
111111 'username ' => 'string not null unique ' ,
112112 'authKey ' => 'string(32) not null ' ,
@@ -121,7 +121,7 @@ protected function setupTestDbData()
121121
122122 // Data :
123123
124- $ db ->createCommand ()->insert ('User ' , [
124+ $ db ->createCommand ()->insert ('user ' , [
125125 'username ' => 'demo ' ,
126126 'authKey ' => Yii::$ app ->getSecurity ()->generateRandomString (),
127127 'passwordHash ' => Yii::$ app ->getSecurity ()->generatePasswordHash ('password ' ),
Original file line number Diff line number Diff line change 22
33namespace yii2mod \user \tests \forms ;
44
5- use Yii ;
65use yii2mod \user \models \BaseUserModel ;
7- use yii2mod \user \models \LoginForm ;
86use yii2mod \user \models \SignupForm ;
97use yii2mod \user \tests \TestCase ;
108
You can’t perform that action at this time.
0 commit comments