CreateMedFormFieldConditionsTables::down()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
use Illuminate\Database\Migrations\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Support\Facades\Schema;
6
7
class CreateMedFormFieldConditionsTables extends Migration
8
{
9
    /**
10
     * Run the migrations.
11
     *
12
     * @return void
13
     */
14
    public function up()
15
    {
16
        if (!Schema::hasTable('med_form_field_conditions')) {
17
            Schema::create('med_form_field_conditions', function (Blueprint $table) {
18
                $table->id();
19
                $table->unsignedBigInteger('form_step_id')->nullable();
20
                $table->foreign('form_step_id')->references('id')->on('med_form_steps')->onDelete('set null');
21
                $table->unsignedBigInteger('form_field_id')->nullable();
22
                $table->foreign('form_field_id')->references('id')->on('med_form_fields')->onDelete('set null');
23
                $table->string('operation')->nullable();
24
                $table->string('eq')->nullable();
25
                $table->string('when')->nullable();
26
                $table->string('show')->nullable();
27
                $table->timestamps();
28
            });
29
        }
30
    }
31
    /**
32
     * Reverse the migrations.
33
     *
34
     * @return void
35
     */
36
    public function down()
37
    {
38
        Schema::dropIfExists('med_form_field_conditions');
39
    }
40
}
41