Completed
Push — master ( f8d0aa...98b092 )
by Manel
02:17
created

CreateSubmodulesTable::up()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 29
Code Lines 23

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 29
rs 8.8571
c 0
b 0
f 0
cc 1
eloc 23
nc 1
nop 0
1
<?php
2
use Illuminate\Support\Facades\Schema;
3
use Illuminate\Database\Schema\Blueprint;
4
use Illuminate\Database\Migrations\Migration;
5
/**
6
 * Class CreateSubmodulesTable.
7
 *
8
 */
9
class CreateSubmodulesTable extends Migration
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
10
{
11
    /**
12
     * Run the migrations.
13
     *
14
     * @return void
15
     */
16
    public function up()
17
    {
18
        Schema::create('submodules', function (Blueprint $table) {
0 ignored issues
show
Bug introduced by
The method create() does not exist on Illuminate\Support\Facades\Schema. Did you maybe mean createFreshMockInstance()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
19
            $table->increments('id');
20
            $table->string('name');
21
            $table->unsignedTinyInteger('order')->nullable();
22
            $table->integer('type')->unsigned()->default(1);
23
            $table->date('total_hours')->nullable();
24
            $table->date('week_hours')->nullable();
25
            $table->date('start_date')->nullable();
26
            $table->date('end_date')->nullable();
27
            $table->timestamps();
28
        });
29
        Schema::create('module_submodule', function (Blueprint $table) {
0 ignored issues
show
Bug introduced by
The method create() does not exist on Illuminate\Support\Facades\Schema. Did you maybe mean createFreshMockInstance()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
30
            $table->integer('module_id')->unsigned();
31
            $table->integer('submodule_id')->unsigned();
32
            $table->timestamps();
33
        });
34
        Schema::create('classroom_submodule', function (Blueprint $table) {
0 ignored issues
show
Bug introduced by
The method create() does not exist on Illuminate\Support\Facades\Schema. Did you maybe mean createFreshMockInstance()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
35
            $table->integer('classroom_id')->unsigned();
36
            $table->integer('submodule_id')->unsigned();
37
            $table->timestamps();
38
        });
39
        Schema::create('course_submodule', function (Blueprint $table) {
0 ignored issues
show
Bug introduced by
The method create() does not exist on Illuminate\Support\Facades\Schema. Did you maybe mean createFreshMockInstance()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
40
            $table->integer('course_id')->unsigned();
41
            $table->integer('submodule_id')->unsigned();
42
            $table->timestamps();
43
        });
44
    }
45
    /**
46
     * Reverse the migrations.
47
     *
48
     * @return void
49
     */
50
    public function down()
51
    {
52
        Schema::dropIfExists('submodules');
53
        Schema::dropIfExists('module_submodule');
54
        Schema::dropIfExists('classroom_submodule');
55
        Schema::dropIfExists('course_submodule');
56
    }
57
}
58