| Conditions | 4 |
| Paths | 4 |
| Total Lines | 19 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | public function up() |
||
| 13 | { |
||
| 14 | $tableOptions = null; |
||
| 15 | if ($this->db->driverName === 'mysql') { |
||
| 16 | $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB'; |
||
| 17 | } |
||
| 18 | |||
| 19 | $this->createTable($this->tableName, [ |
||
| 20 | // 32 (key length) + 32 (keyPrefix length) |
||
| 21 | 'id' => $this->string(64)->notNull() . |
||
| 22 | ($this->db->driverName === 'sqlite' ? ' PRIMARY KEY' : ''), |
||
| 23 | |||
| 24 | // Caching a query to the db with BLOB data type |
||
| 25 | // https://github.com/yiisoft/yii2/issues/9899 |
||
| 26 | 'data' => $this->text(), |
||
| 27 | ], $tableOptions); |
||
| 28 | |||
| 29 | if ($this->db->driverName !== 'sqlite') { |
||
| 30 | $this->addPrimaryKey('settings_pk', $this->tableName, 'id'); |
||
| 31 | } |
||
| 39 |