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

CreateContactsTable::up()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 26

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 26
rs 9.504
c 0
b 0
f 0
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