CreateSermonsTable   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A down() 0 3 1
A up() 0 15 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 CreateSermonsTable extends Migration
8
{
9
    /**
10
     * Run the migrations.
11
     *
12
     * @return void
13
     */
14
    public function up()
15
    {
16
        Schema::create('fg_sermons', function (Blueprint $table) {
17
            $table->string('id', 150)->primary();
18
            $table->string('ministry_id', 150)->index();
19
            $table->string('title');
20
            $table->string('preacher');
21
            $table->date('date')->default(today());
22
            $table->json('main_verses');
23
            $table->json('reference_verses')->nullable();
24
            $table->longText('sermon');
25
            $table->string('resource')->nullable();
26
            $table->timestamps();
27
28
            $table->foreign('ministry_id')->references('id')->on('fg_ministries')->onDelete('cascade');
29
        });
30
    }
31
32
    /**
33
     * Reverse the migrations.
34
     *
35
     * @return void
36
     */
37
    public function down()
38
    {
39
        Schema::dropIfExists('fg_sermons');
40
    }
41
}
42