Completed
Push — master ( d96a7a...d56a4b )
by Mahmoud
04:03
created

CreateTimeTrackerTable   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 0
cbo 2
dl 0
loc 31
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 16 1
A down() 0 4 1
1
<?php
2
3
use Illuminate\Database\Migrations\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
6
/**
7
 * Class CreateTrackingTable
8
 *
9
 * @author  Mahmoud Zalt  <[email protected]>
10
 */
11
class CreateTimeTrackerTable 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...
12
{
13
14
    /**
15
     * Run the migrations.
16
     */
17
    public function up()
18
    {
19
        Schema::create('time_tracker', function (Blueprint $table) {
20
            $table->increments('id');
21
22
            $table->timestamp('open_at')->nullable();
23
            $table->timestamp('close_at')->nullable();
24
25
            $table->string('status')->nullable()->default(NULL);
26
            $table->string('duration')->nullable();
27
28
            $table->integer('user_id')->unsigned()->index();
29
            $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
30
31
        });
32
    }
33
34
    /**
35
     * Reverse the migrations.
36
     */
37
    public function down()
38
    {
39
        Schema::drop('time_tracker');
40
    }
41
}
42