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

33 lines
823 B
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('placa')->unique();
$table->string('modelo');
$table->string('marca');
$table->string('nrpv')->unique()->nullable(); // Número REPUVE
$table->foreignId('owner_id')->nullable()->constrained('owners')->nullOnDelete();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('vehicle');
}
};