Conditions | 1 |
Paths | 1 |
Total Lines | 20 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 14 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
13 | 9 | public function up() { |
|
14 | DB::transaction(function () { |
||
15 | Schema::create('movie_earnings', function (Blueprint $table) { |
||
16 | 9 | $table->increments('id'); |
|
17 | 9 | $table->unsignedInteger('movie_id'); |
|
18 | 9 | $table->date('date'); |
|
19 | 9 | $table->unsignedBigInteger('domestic')->nullable(); |
|
20 | 9 | $table->unsignedBigInteger('worldwide')->nullable(); |
|
21 | 9 | $table->timestamps(); |
|
22 | |||
23 | 9 | $table->foreign('movie_id')->references('id')->on('movies')->onUpdate('cascade')->onDelete('cascade'); |
|
24 | 9 | }); |
|
25 | |||
26 | Schema::table('movies', function (Blueprint $table) { |
||
27 | 9 | $table->foreign('latest_earnings_id')->references('id')->on('movie_earnings')->onUpdate('set null') |
|
28 | 9 | ->onDelete('cascade'); |
|
29 | 9 | }); |
|
30 | |||
31 | 9 | }); |
|
32 | 9 | } |
|
33 | |||
50 |
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.