Passed
Push — master ( 2a90e7...a622eb )
by Ron
02:27 queued 14s
created

CreateTechTipsTable   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 13
c 1
b 0
f 0
dl 0
loc 31
rs 10
wmc 2
1
<?php
2
3
use Illuminate\Support\Facades\Schema;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Database\Migrations\Migration;
6
7
class CreateTechTipsTable extends Migration
8
{
9
    /**
10
     * Run the migrations.
11
     *
12
     * @return void
13
     */
14
    public function up()
15
    {
16
        Schema::create('tech_tips', function(Blueprint $table) {
17
            $table->increments('tip_id');
18
            $table->integer('user_id')->unsigned();
19
            $table->integer('updated_id')->unsigned()->nullable();
20
            $table->boolean('public')->default(0);
21
            $table->boolean('sticky')->default(0);
22
            $table->bigInteger('tip_type_id')->unsigned();
23
            $table->text('subject');
24
            $table->longText('description');
25
            $table->softDeletes();
26
            $table->timestamps();
27
            $table->foreign('user_id')->references('user_id')->on('users')->onUpdate('cascade');
28
            $table->foreign('updated_id')->references('user_id')->on('users')->onUpdate('cascade');
29
            $table->foreign('tip_type_id')->references('tip_type_id')->on('tech_tip_types')->onUpdate('cascade');
30
        });
31
    }
32
33
    /**
34
     * Reverse the migrations.
35
     *
36
     * @return void
37
     */
38
    public function down()
39
    {
40
        Schema::dropIfExists('tech_tips');
41
    }
42
}
43