Passed
Push — master ( 2a90e7...a622eb )
by Ron
02:27 queued 14s
created

CreateCustomerContactsTable   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 28
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 CreateCustomerContactsTable extends Migration
8
{
9
    /**
10
     * Run the migrations.
11
     *
12
     * @return void
13
     */
14
    public function up()
15
    {
16
        Schema::create('customer_contacts', function(Blueprint $table) {
17
            $table->increments('cont_id');
18
            $table->integer('cust_id')->unsigned();
19
            $table->boolean('shared')->default(0);
20
            $table->text('name');
21
            $table->text('email')->nullable();
22
            $table->timestamps();
23
            $table->foreign('cust_id')->references('cust_id')->on('customers')->onUpdate('cascade')->onDelete('cascade');
24
        });
25
    }
26
27
    /**
28
     * Reverse the migrations.
29
     *
30
     * @return void
31
     */
32
    public function down()
33
    {
34
        Schema::dropIfExists('customer_contacts');
35
    }
36
}
37