CreateReviewsTable   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
c 0
b 0
f 0
dl 0
loc 29
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 11 1
A down() 0 3 1
1
<?php
2
3
use FaithGen\SDK\Helpers\Helper;
4
use Illuminate\Database\Migrations\Migration;
5
use Illuminate\Database\Schema\Blueprint;
6
use Illuminate\Support\Facades\Schema;
7
8
class CreateReviewsTable extends Migration
9
{
10
    /**
11
     * Run the migrations.
12
     *
13
     * @return void
14
     */
15
    public function up()
16
    {
17
        Schema::create('fg_reviews', function (Blueprint $table) {
18
            $table->string('id')->index();
19
            $table->string('ministry_id', 150)->index();
20
            $table->enum('type', Helper::$reviewTypes);
21
            $table->text('review');
22
            $table->boolean('read')->default(false);
23
            $table->timestamps();
24
25
            $table->foreign('ministry_id')->references('id')->on('fg_ministries')->onDelete('cascade');
26
        });
27
    }
28
29
    /**
30
     * Reverse the migrations.
31
     *
32
     * @return void
33
     */
34
    public function down()
35
    {
36
        Schema::dropIfExists('fg_reviews');
37
    }
38
}
39