<?php

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

class CreateProductOrdersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        /*
         *
        'wechat_id', // 微信号id(open_id)
    	'product_id', // 产品名称
		'product_name', // 产品信息
        'color', // 产品颜色款色
		'unit', // 产品单格
		'amount', // 产品数量
		'price', // 订单总价
		'status', // 订单状态
		'remark', // 买家备注
		'info', // 卖家信息
		'contact', // 买家联系人
		'address', // 买家地址
		'phone' // 买家手机号码
         */
        Schema::create('product_orders', function (Blueprint $table) {
            $table->increments('id');
            $table->timestamps();
            $table->string('wechat_id');
            $table->unsignedInteger('product_id');
            $table->string('product_name');
            $table->string('color');
            $table->double('unit');
            $table->integer('amount');
            $table->double('price');
            $table->integer('status');
            $table->string('remark');
            $table->string('info');
            $table->string('contact');
            $table->string('address');
            $table->string('phone');
            $table->string('photo');
            $table->unsignedInteger('comment_id');
            $table->timestamp("paid_at");
        });
    }

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