<?php

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

class CreatePackingListPackagesTables extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('packing_list_packages_tables', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('packing_list_id')->unsigned()->index();
            $table->integer('package_id')->unsigned()->index();
            $table->timestamps();

            $table->foreign('packing_list_id')->references('id')->on('packing_lists');
        });
    }

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