| Conditions | 2 |
| Paths | 2 |
| Total Lines | 34 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | public function up() |
||
| 15 | { |
||
| 16 | $tableOptions = null; |
||
| 17 | if ($this->db->driverName === 'mysql') { |
||
| 18 | $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB'; |
||
| 19 | } |
||
| 20 | |||
| 21 | $this->createTable('field', [ |
||
| 22 | 'id' => $this->primaryKey()->notNull()->append('AUTO_INCREMENT'), |
||
| 23 | 'template_id' => $this->integer()->notNull(), |
||
| 24 | 'x1' => $this->float()->notNull(), |
||
| 25 | 'y1' => $this->float()->notNull(), |
||
| 26 | 'x2' => $this->float()->notNull(), |
||
| 27 | 'y2' => $this->float()->notNull(), |
||
| 28 | 'css' => $this->text(), |
||
| 29 | 'js' => $this->text(), |
||
| 30 | ], $tableOptions); |
||
| 31 | |||
| 32 | $this->createIndex( |
||
| 33 | 'fk_field_template1_idx', |
||
| 34 | 'field', |
||
| 35 | 'template_id' |
||
| 36 | ); |
||
| 37 | |||
| 38 | $this->addForeignKey( |
||
| 39 | 'fk_field_template1', |
||
| 40 | 'field', |
||
| 41 | 'template_id', |
||
| 42 | 'screen_template', |
||
| 43 | 'id', |
||
| 44 | 'CASCADE', |
||
| 45 | 'CASCADE' |
||
| 46 | ); |
||
| 47 | } |
||
| 48 | |||
| 57 |