<?php

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

class CreateCombinationGoodsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if (Schema::hasTable('combination_goods')) {
            return;
        }
        Schema::create('combination_goods', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedBigInteger('goods_sku_id');
            $table->unsignedBigInteger('item_id');
            $table->unsignedInteger('item_num');
            $table->timestamps();
        });
    }

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