Conditions | 2 |
Paths | 2 |
Total Lines | 20 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
12 | public function up() |
||
13 | { |
||
14 | $tableOptions = null; |
||
15 | |||
16 | if ($this->db->driverName === 'mysql') { |
||
17 | // http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci |
||
18 | $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB'; |
||
19 | } |
||
20 | |||
21 | $this->createTable('{{%user}}', [ |
||
22 | 'id' => $this->primaryKey(), |
||
23 | 'username' => $this->string()->notNull()->unique(), |
||
24 | 'auth_key' => $this->string(32)->notNull(), |
||
25 | 'password_hash' => $this->string()->notNull(), |
||
26 | 'password_reset_token' => $this->string()->unique(), |
||
27 | 'email' => $this->string()->notNull()->unique(), |
||
28 | 'status' => $this->smallInteger()->notNull()->defaultValue(10), |
||
29 | 'created_at' => $this->integer()->notNull(), |
||
30 | 'updated_at' => $this->integer()->notNull(), |
||
31 | ], $tableOptions); |
||
32 | } |
||
39 |