<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateOrdersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('orders', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('member_id');
            $table->string('order_id');
            $table->string('receive_name');
            $table->string('receive_phone');
            $table->string('receive_address');
            $table->decimal('total_fee', 18, 2)->default(0.00);
            $table->tinyInteger('order_status')->default(0);
            $table->tinyInteger('status')->default(0)->comment('0 待付款 1 待发货 2 已发货 3 已完成');
            $table->integer('express_id')->default(0);
            $table->string('express_order')->nullable();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('orders');
    }
}
