Conditions | 2 |
Paths | 2 |
Total Lines | 22 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
10 | public function up() |
||
11 | { |
||
12 | $tableOptions = null; |
||
13 | |||
14 | if ($this->db->driverName === 'mysql') { |
||
15 | $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB'; |
||
16 | } |
||
17 | |||
18 | // Create user table |
||
19 | $this->createTable('{{%User}}', [ |
||
20 | 'id' => $this->primaryKey(), |
||
21 | 'username' => $this->string()->notNull()->unique(), |
||
22 | 'authKey' => $this->string(32)->notNull(), |
||
23 | 'passwordHash' => $this->string()->notNull(), |
||
24 | 'passwordResetToken' => $this->string()->unique(), |
||
25 | 'email' => $this->string()->notNull()->unique(), |
||
26 | 'status' => $this->smallInteger()->notNull()->defaultValue(1), |
||
27 | 'createdAt' => $this->integer()->notNull(), |
||
28 | 'updatedAt' => $this->integer()->notNull(), |
||
29 | 'lastLogin' => $this->integer(), |
||
30 | ], $tableOptions); |
||
31 | } |
||
32 | |||
49 |