Passed
Pull Request — master (#83)
by Ron
25:57
created

CreateCustomerSystemsTable   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 29
rs 10
wmc 2
1
<?php
2
3
use Illuminate\Support\Facades\Schema;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Database\Migrations\Migration;
6
7
class CreateCustomerSystemsTable extends Migration
8
{
9
    /**
10
     * Run the migrations.
11
     *
12
     * @return void
13
     */
14
    public function up()
15
    {
16
        Schema::create('customer_systems', function(Blueprint $table) {
17
            $table->increments('cust_sys_id');
18
            $table->integer('cust_id')->unsigned();
19
            $table->integer('sys_id')->unsigned();
20
            $table->boolean('shared')->default(0);
21
            $table->softDeletes();
22
            $table->timestamps();
23
            $table->foreign('cust_id')->references('cust_id')->on('customers')->onUpdate('cascade')->onDelete('cascade');
24
            $table->foreign('sys_id')->references('sys_id')->on('system_types')->onUpdate('cascade');
25
        });
26
    }
27
28
    /**
29
     * Reverse the migrations.
30
     *
31
     * @return void
32
     */
33
    public function down()
34
    {
35
        Schema::dropIfExists('customer_systems');
36
    }
37
}
38