Conditions | 5 |
Paths | 5 |
Total Lines | 23 |
Code Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Tests | 15 |
CRAP Score | 5.0406 |
Changes | 0 |
1 | <?php |
||
21 | 24 | public function up() |
|
22 | { |
||
23 | 24 | $dataType = $this->binary(); |
|
24 | 24 | $tableOptions = null; |
|
25 | |||
26 | 24 | switch ($this->db->driverName) { |
|
27 | 24 | case 'mysql': |
|
28 | // http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci |
||
29 | 8 | $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB'; |
|
30 | 8 | break; |
|
31 | 16 | case 'sqlsrv': |
|
32 | 16 | case 'mssql': |
|
33 | 16 | case 'dblib': |
|
34 | $dataType = $this->text(); |
||
35 | break; |
||
36 | } |
||
37 | |||
38 | 24 | $this->createTable('{{%session}}', [ |
|
39 | 24 | 'id' => $this->string()->notNull(), |
|
40 | 24 | 'expire' => $this->integer(), |
|
41 | 24 | 'data' => $dataType, |
|
42 | 24 | 'PRIMARY KEY ([[id]])', |
|
43 | ], $tableOptions); |
||
44 | 24 | } |
|
54 |