Conditions | 1 |
Paths | 1 |
Total Lines | 18 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
28 | public function change() |
||
29 | { |
||
30 | $pages = $this->table('pages'); |
||
31 | $pages |
||
32 | ->addColumn('userId', 'integer') |
||
33 | ->addColumn('title', 'text') |
||
34 | ->addColumn('alias', 'string', ['length' => 255]) |
||
35 | ->addColumn('content', 'text') |
||
36 | ->addColumn('keywords', 'text') |
||
37 | ->addColumn('description', 'text') |
||
38 | ->addTimestamps('created', 'updated') |
||
39 | ->addForeignKey('userId', 'users', 'id', [ |
||
40 | 'delete' => 'CASCADE', |
||
41 | 'update' => 'CASCADE' |
||
42 | ]) |
||
43 | ->addIndex(['alias'], ['unique' => true]) |
||
44 | ->create(); |
||
45 | } |
||
46 | } |
||
47 |
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.