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