Passed
Push — master ( 216e85...786672 )
by Nasrul Hazim
03:34
created

CreateAddressesTable   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 15
dl 0
loc 29
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A down() 0 3 1
A up() 0 15 1
1
<?php
2
3
use Illuminate\Database\Migrations\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Support\Facades\Schema;
6
7
class CreateAddressesTable extends Migration
8
{
9
    /**
10
     * Run the migrations.
11
     */
12
    public function up()
13
    {
14
        Schema::create('addresses', function (Blueprint $table) {
15
            $table->increments('id');
16
            $table->hashslug();
17
            $table->nullableBelongsTo('countries');
18
            $table->unsignedInteger('addressable_id');
19
            $table->string('addressable_type');
20
            $table->text('primary')->nullable();
21
            $table->text('secondary')->nullable();
22
            $table->string('postcode')->nullable();
23
            $table->string('city')->nullable();
24
            $table->string('state')->nullable();
25
            $table->is('default');
26
            $table->standardTime();
27
        });
28
    }
29
30
    /**
31
     * Reverse the migrations.
32
     */
33
    public function down()
34
    {
35
        Schema::dropIfExists('addresses');
36
    }
37
}
38