<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('sitios_embarcaciones', function (Blueprint $table) {
            $table->increments('id');
            $table->string('nombre', 120);
            $table->string('imo', 20)->nullable();
            $table->string('tipo_buque', 50)->nullable();
            $table->string('bandera', 50)->nullable();
            $table->string('responsable', 120)->nullable();
            $table->unsignedInteger('cantidad_personas')->nullable();
            $table->string('tipo', 30)->default('sitio');
            $table->string('ubicacion', 120)->nullable();
            $table->tinyInteger('activo')->default(1);
            $table->text('observacion')->nullable();
            $table->timestamp('fechaCreacion')->useCurrent();
            $table->timestamp('fechaActualizacion')->useCurrent()->useCurrentOnUpdate();
            $table->string('cedulaEditor', 20)->nullable();
        });
    }

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