Completed
Push — master ( 3bd578...cfd7eb )
by Abdelrahman
02:01 queued 10s
created

CreateAddressesTable::down()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
use Illuminate\Support\Facades\Schema;
6
use Illuminate\Database\Schema\Blueprint;
7
use Illuminate\Database\Migrations\Migration;
8
9
class CreateAddressesTable extends Migration
10
{
11
    public function up()
12
    {
13
        Schema::create(config('rinvex.addresses.tables.addresses'), function (Blueprint $table) {
14
            // Columns
15
            $table->increments('id');
16
            $table->morphs('addressable');
17
            $table->string('given_name');
18
            $table->string('family_name');
19
            $table->string('label')->nullable();
20
            $table->string('organization')->nullable();
21
            $table->string('country_code', 2)->nullable();
22
            $table->string('street')->nullable();
23
            $table->string('state')->nullable();
24
            $table->string('city')->nullable();
25
            $table->string('postal_code')->nullable();
26
            $table->decimal('latitude', 10, 7)->nullable();
27
            $table->decimal('longitude', 10, 7)->nullable();
28
            $table->boolean('is_primary')->default(false);
29
            $table->boolean('is_billing')->default(false);
30
            $table->boolean('is_shipping')->default(false);
31
            $table->timestamps();
32
            $table->softDeletes();
33
        });
34
    }
35
36
    public function down()
37
    {
38
        Schema::dropIfExists(config('rinvex.addresses.tables.addresses'));
39
    }
40
}
41