Conditions | 1 |
Paths | 1 |
Total Lines | 16 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
38 | public function change() |
||
39 | { |
||
40 | $table = $this->table('categories'); |
||
41 | $table |
||
42 | ->addColumn('rootId', 'integer') |
||
43 | ->addColumn('parentId', 'integer', ['null' => true]) |
||
44 | ->addColumn('name', 'string', ['length' => 255]) |
||
45 | ->addColumn('alias', 'string', ['length' => 255]) |
||
46 | ->addTimestamps('created', 'updated') |
||
47 | ->addForeignKey('parentId', 'categories', 'id', [ |
||
48 | 'delete' => 'CASCADE', |
||
49 | 'update' => 'CASCADE' |
||
50 | ]) |
||
51 | ->addIndex(['parentId', 'alias'], ['unique' => true, 'name' => 'UNIQUE_categories_alias']) |
||
52 | ->create(); |
||
53 | } |
||
54 | } |
||
55 |
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.