repuve-backend-v1/database/migrations/2025_10_18_140600_create_vehicle_table.php

57 lines
2.1 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('vehicle', function (Blueprint $table) {
$table->id();
$table->string('anio_placa')->nullable();
$table->string('placa')->unique()->nullable();
$table->string('numero_serie')->unique()->nullable();
$table->string('rfc')->nullable();
$table->string('vigencia')->nullable();
$table->string('fecha_impresion')->nullable();
$table->string('qr_hash')->nullable();
$table->boolean('valido')->nullable();
$table->boolean('foliotemp')->nullable();
$table->string('nombre')->nullable();
$table->string('nombre2')->nullable();
$table->string('municipio')->nullable();
$table->string('localidad')->nullable();
$table->string('calle')->nullable();
$table->string('calle2')->nullable();
$table->string('tipo')->nullable();
$table->string('tipo_servicio')->nullable();
$table->string('marca')->nullable();
$table->string('linea')->nullable();
$table->string('sublinea')->nullable();
$table->string('modelo')->nullable();
$table->string('numero_motor')->nullable();
$table->string('descripcion_origen')->nullable();
$table->string('color')->nullable();
$table->string('codigo_postal')->nullable();
$table->string('serie_folio')->unique()->nullable();
$table->string('sfolio')->unique()->nullable();
$table->string('nrpv')->unique()->nullable();
$table->foreignId('owner_id')->nullable()->constrained('owners')->nullOnDelete();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('vehicle');
}
};