<?php

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

/**
 * Migration auto-generated by Sequel Pro Laravel Export
 * @see https://github.com/cviebrock/sequel-pro-laravel-export
 */
class CreateS1OrderGoodsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('s1_order_goods', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('s1_order_id');
            $table->integer('s1_goods_id')->comment('商品ID');
            $table->integer('number')->comment('订单商品数量');
            $table->integer('price')->comment('订单商品价格');
            $table->nullableTimestamps();
            $table->softDeletes();

            $table->index('s1_order_id', 's1_order_goods_s1_order_id_foreign');
            $table->index('s1_goods_id', 's1_order_goods_s1_goods_id_foreign');

            

        });
    }

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