<?php

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

return new class extends Migration
{
    public function up(): void
    {
        Schema::create('ride_models', function (Blueprint $table) {
            $table->id();
            $table->string('name');
            $table->foreignId('manufacturer_id')->nullable()->constrained('manufacturers')->nullOnDelete();
            $table->text('description')->default('');
            $table->string('category', 2)->default('');
            $table->timestamps();

            $table->unique(['manufacturer_id', 'name']);
        });
    }

    public function down(): void
    {
        Schema::dropIfExists('ride_models');
    }
};