Conditions | 2 |
Paths | 2 |
Total Lines | 17 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | public function up() |
||
18 | { |
||
19 | $menuTable = Configs::instance()->menuTable; |
||
20 | $tableOptions = null; |
||
21 | if ($this->db->driverName === 'mysql') { |
||
22 | $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB'; |
||
23 | } |
||
24 | |||
25 | $this->createTable($menuTable, [ |
||
26 | 'id' => $this->primaryKey(), |
||
27 | 'name' => $this->string(128)->notNull(), |
||
28 | 'parent' => $this->integer(), |
||
29 | 'route' => $this->string(), |
||
30 | 'order' => $this->integer(), |
||
31 | 'data' => $this->binary(), |
||
32 | "FOREIGN KEY ([[parent]]) REFERENCES {$menuTable}([[id]]) ON DELETE SET NULL ON UPDATE CASCADE", |
||
33 | ], $tableOptions); |
||
34 | } |
||
44 |