CreateTestimoniesTable   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 5
dl 0
loc 34
rs 10
c 0
b 0
f 0

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
use Illuminate\Support\Facades\Schema;
6
7
class CreateTestimoniesTable extends Migration
8
{
9
    /**
10
     * Run the migrations.
11
     *
12
     * @return void
13
     */
14
    public function up()
15
    {
16
        Schema::create('fg_testimonies', function (Blueprint $table) {
17
            $table->string('id', 150)->primary();
18
            $table->string('ministry_id', 150)->index();
19
            $table->string('user_id', 150)->index();
20
            $table->string('title');
21
            $table->text('testimony');
22
            $table->string('resource')->nullable();
23
            $table->boolean('approved')->default(false);
24
            $table->timestamps();
25
26
            $table->foreign('ministry_id')->references('id')->on('fg_ministries')->onDelete('cascade');
27
            $table->foreign('user_id')->references('id')->on('fg_users')->onDelete('cascade');
28
        });
29
    }
30
31
    /**
32
     * Reverse the migrations.
33
     *
34
     * @return void
35
     */
36
    public function down()
37
    {
38
        Schema::dropIfExists('fg_testimonies');
39
    }
40
}
41