CreateTasksTable::down()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
use Illuminate\Database\Migrations\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Support\Facades\Schema;
6
7
class CreateTasksTable extends Migration
8
{
9
    /**
10
     * Run the migrations.
11
     *
12
     * @return void
13
     */
14
    public function up()
15
    {
16
        Schema::create('tasks', function (Blueprint $table) {
17
            $table->bigIncrements('id');
18
19
            $table->foreignId('user_id')->nullable()
20
            ->references(user_model()->getKeyName())
21
            ->on(user_model()->getTable());
22
23
            $table->foreignId('priority_id')->nullable()
24
            ->references('id')
25
            ->on('priorities');
26
27
            $table->string('title');
28
            $table->text('description')->nullable();
29
            $table->text('notes')->nullable();
30
31
            $table->boolean('complete')->nullable()->default(false);
32
33
            // TODO:
34
            // cost
35
            // budget
36
37
            // time allocated
38
            $table->timestamps();
39
        });
40
    }
41
42
    /**
43
     * Reverse the migrations.
44
     *
45
     * @return void
46
     */
47
    public function down()
48
    {
49
        Schema::dropIfExists('tasks');
50
    }
51
}
52