<?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('plate_rgm_details', function (Blueprint $table) {
            $table->id();
            $table->char('plate_name', 7)->unique()->collation('utf8mb4_bin');
            $table->string('marca')->nullable();
            $table->string('referencia')->nullable();
            $table->string('modelo')->nullable();
            $table->string('serial_chasis')->nullable();
            $table->string('motor')->nullable();
            $table->string('acreedor')->nullable();
            $table->string('deudor')->nullable();
            $table->string('monto')->nullable();
            $table->string('fecha_inscripcion')->nullable();
            $table->boolean('tiene_restriccion')->default(false);
            $table->string('tipo_garantia')->nullable();
            $table->timestamp('last_scraped_at')->nullable();
            $table->timestamps();
        });
    }

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