Completed
Push — master ( d041e8...b5961c )
by Abdelrahman
01:30 queued 12s
created

CreateContactsTable   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 4
dl 0
loc 34
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 26 1
A down() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
use Illuminate\Support\Facades\Schema;
5
use Illuminate\Database\Schema\Blueprint;
6
use Illuminate\Database\Migrations\Migration;
7
8
class CreateContactsTable extends Migration
9
{
10
    public function up()
11
    {
12
        Schema::create(config('rinvex.contacts.tables.contacts'), function (Blueprint $table) {
13
            // Columns
14
            $table->increments('id');
15
            $table->morphs('entity');
16
            $table->string('given_name');
17
            $table->string('family_name')->nullable();
18
            $table->string('title')->nullable();
19
            $table->string('organization')->nullable();
20
            $table->string('email')->nullable();
21
            $table->string('phone')->nullable();
22
            $table->string('fax')->nullable();
23
            $table->string('country_code', 2)->nullable();
24
            $table->string('language_code', 2)->nullable();
25
            $table->date('birthday')->nullable();
26
            $table->string('gender')->nullable();
27
            $table->string('national_id_type')->nullable();
28
            $table->string('national_id')->nullable();
29
            $table->string('source')->nullable();
30
            $table->string('method')->nullable();
31
            $table->text('notes')->nullable();
32
            $table->timestamps();
33
            $table->softDeletes();
34
        });
35
    }
36
37
    public function down()
38
    {
39
        Schema::dropIfExists(config('rinvex.contacts.tables.contacts'));
40
    }
41
}
42