Conditions | 2 |
Paths | 2 |
Total Lines | 24 |
Code Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | public function up() |
||
14 | { |
||
15 | $tableOptions = null; |
||
16 | |||
17 | if ('mysql' === $this->db->driverName) { |
||
18 | $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB'; |
||
19 | } |
||
20 | |||
21 | $this->createTable('{{%Comment}}', [ |
||
22 | 'id' => $this->primaryKey(), |
||
23 | 'entity' => $this->char(10)->notNull(), |
||
24 | 'entityId' => $this->integer()->notNull(), |
||
25 | 'content' => $this->text()->notNull(), |
||
26 | 'parentId' => $this->integer()->null(), |
||
27 | 'level' => $this->smallInteger()->notNull()->defaultValue(1), |
||
28 | 'createdBy' => $this->integer()->notNull(), |
||
29 | 'updatedBy' => $this->integer()->notNull(), |
||
30 | 'status' => $this->smallInteger()->notNull()->defaultValue(1), |
||
31 | 'createdAt' => $this->integer()->notNull(), |
||
32 | 'updatedAt' => $this->integer()->notNull(), |
||
33 | ], $tableOptions); |
||
34 | |||
35 | $this->createIndex('idx-Comment-entity', '{{%Comment}}', 'entity'); |
||
36 | $this->createIndex('idx-Comment-status', '{{%Comment}}', 'status'); |
||
37 | } |
||
47 |