CreateDailyServicesTable   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 12 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 CreateDailyServicesTable extends Migration
9
{
10
    /**
11
     * Run the migrations.
12
     *
13
     * @return void
14
     */
15
    public function up()
16
    {
17
        Schema::create('fg_daily_services', function (Blueprint $table) {
18
            $table->string('id')->index();
19
            $table->string('ministry_id', 150)->index();
20
            $table->enum('day', Helper::$weekDays);
21
            $table->string('alias')->nullable();
22
            $table->string('start');
23
            $table->string('finish');
24
            $table->timestamps();
25
26
            $table->foreign('ministry_id')->references('id')->on('fg_ministries')->onDelete('cascade');
27
        });
28
    }
29
30
    /**
31
     * Reverse the migrations.
32
     *
33
     * @return void
34
     */
35
    public function down()
36
    {
37
        Schema::dropIfExists('fg_daily_services');
38
    }
39
}
40