CreateCartsTable::down()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php namespace Bedard\Shop\Updates;
2
3
use October\Rain\Database\Schema\Blueprint;
4
use October\Rain\Database\Updates\Migration;
5
use Schema;
6
7
class CreateCartsTable extends Migration
8
{
9
    public function up()
10
    {
11
        Schema::create('bedard_shop_carts', function (Blueprint $table) {
12
            $table->engine = 'InnoDB';
13
            $table->increments('id');
14
            $table->string('token', 40)->index();
15
            $table->integer('update_count')->unsigned()->default(0);
16
            $table->integer('item_count')->unsigned()->default(0);
17
            $table->decimal('item_total', 10, 2)->unsigned()->default(0);
18
            $table->timestamp('abandoned_at')->nullable();
19
            $table->timestamp('closed_at')->nullable();
20
            $table->timestamps();
21
        });
22
    }
23
24
    public function down()
25
    {
26
        Schema::dropIfExists('bedard_shop_carts');
27
    }
28
}
29