Completed
Push — master ( 2289fe...fc9f33 )
by Scott
02:28
created

CreateAddressesTable::up()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 20
Code Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 20
rs 9.4285
cc 1
eloc 17
nc 1
nop 0
1
<?php namespace Bedard\Shop\Updates;
2
3
use Schema;
4
use October\Rain\Database\Schema\Blueprint;
5
use October\Rain\Database\Updates\Migration;
6
7
class CreateAddressesTable extends Migration
8
{
9
    public function up()
10
    {
11
        Schema::create('bedard_shop_addresses', function(Blueprint $table) {
12
            $table->engine = 'InnoDB';
13
            $table->increments('id');
14
            $table->integer('customer_id')->unsigned()->index();
15
            $table->boolean('is_primary')->default(false);
16
            $table->boolean('is_billing')->default(false);
17
            $table->boolean('is_shipping')->default(false);
18
            $table->string('line_1')->default('');
19
            $table->string('line_2')->default('');
20
            $table->string('line_3')->default('');
21
            $table->string('city')->default('');
22
            $table->string('province')->default('');
23
            $table->string('postcode')->default('');
24
            $table->string('country')->default('');
25
            $table->text('additional_data');
26
            $table->timestamps();
27
        });
28
    }
29
30
    public function down()
31
    {
32
        Schema::dropIfExists('bedard_shop_addresses');
33
    }
34
}
35