<?php

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

return new class extends Migration
{
    public function up(): void
    {
        Schema::create('mangueras', function (Blueprint $table) {
            $table->increments('id_manguera');
            $table->unsignedInteger('id_cara');
            $table->unsignedInteger('id_tipo_combustible');
            $table->string('numero_manguera', 20);
            $table->tinyInteger('estado')->default(1);

            $table->foreign('id_cara')->references('id_cara')->on('caras_estacion')->cascadeOnDelete();
            $table->foreign('id_tipo_combustible')->references('id_tipo_combustible')->on('tipos_combustible')->cascadeOnDelete();
        });
    }

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