<?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('caras_estacion', function (Blueprint $table) {
            $table->increments('id_cara');
            $table->unsignedInteger('id_estacion');
            $table->string('nombre', 20);
            $table->tinyInteger('estado')->default(1);

            $table->foreign('id_estacion')->references('id_estacion')->on('estaciones')->cascadeOnDelete();
        });
    }

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