| Conditions | 1 |
| Paths | 1 |
| Total Lines | 27 |
| Code Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | public function up() |
||
| 9 | { |
||
| 10 | Schema::create('meeting_attachments', function (Blueprint $table) { |
||
| 11 | $table->increments('id'); |
||
| 12 | |||
| 13 | $table->string('filename'); |
||
| 14 | $table->string('storage_filename'); |
||
| 15 | |||
| 16 | $table->float('size')->comment('kilobytes'); |
||
| 17 | |||
| 18 | $table->unsignedInteger('meeting_id')->nullable(); |
||
| 19 | $table->foreign('meeting_id') |
||
| 20 | ->references('id') |
||
| 21 | ->on('meetings') |
||
| 22 | ->onDelete('set null') // so we can later see that the attachment is not used and delete the file |
||
| 23 | ->onUpdate('cascade'); |
||
| 24 | |||
| 25 | $table->unsignedInteger('owner_id')->nullable(); |
||
| 26 | $table->foreign('owner_id') |
||
| 27 | ->references('id') |
||
| 28 | ->on('members') |
||
| 29 | ->onDelete('set null') |
||
| 30 | ->onUpdate('cascade'); |
||
| 31 | |||
| 32 | $table->timestamps(); |
||
| 33 | }); |
||
| 34 | } |
||
| 35 | |||
| 41 |
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.