<?php

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

class CreateOrderPackageCommoditiesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('order_package_commodities', function (Blueprint $table) {
            $table->id();
            $table->timestamps();

            $table->integer('order_package_id')->index()->comment('包裹表');
            $table->integer('commodity_id')->index()->comment('商品');
            $table->integer('amount')->comment('数量');
        });
    }

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