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

CreateTimeTrackerTable::down()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
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