| Conditions | 1 |
| Paths | 1 |
| Total Lines | 16 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 35 | public function change() |
||
| 36 | { |
||
| 37 | $table = $this->table('categories'); |
||
| 38 | $table |
||
| 39 | ->addColumn('rootId', 'integer') |
||
| 40 | ->addColumn('parentId', 'integer', ['null' => true]) |
||
| 41 | ->addColumn('name', 'string', ['length' => 255]) |
||
| 42 | ->addColumn('alias', 'string', ['length' => 255]) |
||
| 43 | ->addTimestamps('created', 'updated') |
||
| 44 | ->addForeignKey('parentId', 'categories', 'id', [ |
||
| 45 | 'delete' => 'CASCADE', |
||
| 46 | 'update' => 'CASCADE' |
||
| 47 | ]) |
||
| 48 | ->addIndex(['parentId', 'alias'], ['unique' => true, 'name' => 'UNIQUE_categories_alias']) |
||
| 49 | ->create(); |
||
| 50 | } |
||
| 51 | } |
||
| 52 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.