| Conditions | 1 |
| Paths | 1 |
| Total Lines | 16 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | public function change() |
||
| 32 | { |
||
| 33 | $table = $this->table('options', ['id' => false, 'primary_key' => ['namespace', 'key']]); |
||
| 34 | $table |
||
| 35 | ->addColumn('userId', 'integer') |
||
| 36 | ->addColumn('namespace', 'string', ['length' => 255, 'default' => 'default']) |
||
| 37 | ->addColumn('key', 'string', ['length' => 255]) |
||
| 38 | ->addColumn('value', 'text') |
||
| 39 | ->addColumn('description', 'text', ['null' => true]) |
||
| 40 | ->addTimestamps('created', 'updated') |
||
| 41 | ->addForeignKey('userId', 'users', 'id', [ |
||
| 42 | 'delete' => 'CASCADE', |
||
| 43 | 'update' => 'CASCADE' |
||
| 44 | ]) |
||
| 45 | ->create(); |
||
| 46 | } |
||
| 47 | } |
||
| 48 |
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.