CreateCoachesTable::down()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 3
Bugs 0 Features 2
Metric Value
c 3
b 0
f 2
dl 4
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
use Illuminate\Database\Capsule\Manager as Capsule;
4
use \Illuminate\Database\Schema\Blueprint as Blueprint;
5
6 View Code Duplication
class CreateCoachesTable
7
{
8
    /**
9
     * Run the migrations.
10
     *
11
     * @return void
12
     */
13
    public function run()
14
    {
15
        Capsule::schema()->dropIfExists('coaches');
16
        Capsule::schema()->create('coaches', function (Blueprint $table) {
17
            $table->increments('id');
18
            $table->string('name');
19
            $table->string('surname');
20
            $table->tinyInteger('age');
21
            $table->string('nationality',2);
22
            $table->float('skillAvg');
23
            $table->float('wageReq');
24
            $table->string('favouriteModule',10);
25
            $table->integer('team_id')->nullable();
26
            $table->timestamps();
27
        });
28
    }
29
30
    /**
31
     * Reverse the migrations.
32
     *
33
     * @return void
34
     */
35
    public function down()
36
    {
37
        Schema::drop('coaches');
38
    }
39
}
40