arcos-backend/database/migrations/2025_12_19_122433_create_vehicles_table.php

47 lines
1.2 KiB
PHP

<?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('vehicles', function (Blueprint $table) {
$table->id();
// Identificadores del vehículo
$table->string('epc')->unique();
$table->string('vin')->nullable();
$table->string('placa')->nullable();
// Datos del reporte de robo
$table->date('fecha_robo')->nullable();
$table->string('autoridad_robo')->nullable();
$table->string('acta_robo')->nullable();
$table->string('denunciante')->nullable();
$table->date('fecha_acta')->nullable();
// Datos de recuperación
$table->timestamp('fecha_recuperacion')->nullable();
// Datos completos del robo original (JSON) - Para auditoría
$table->json('datos_robo_original')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('vehicles');
}
};