<?php

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

class CreateAlmacenesInsumosTable extends Migration
{
    public function up()
    {
        Schema::create('almacenes_insumos', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('almacen_id');
            $table->unsignedBigInteger('insumo_id');
            $table->unsignedInteger('stock');
            $table->timestamps();

            $table->foreign('almacen_id')->references('id')->on('almacenes');
            $table->foreign('insumo_id')->references('id')->on('insumos');
        });
    }

    public function down()
    {
        Schema::dropIfExists('almacenes_insumos');
    }
}
