<?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::table('vehicles', function (Blueprint $table) {
            $table->string('name')->after('id');
            $table->string('model')->after('name');
            $table->text('description')->after('model');
            $table->integer('seating_capacity')->after('description');
            $table->string('luggage_space')->after('seating_capacity');
            $table->json('amenities')->nullable()->after('luggage_space');
            $table->decimal('daily_rate', 10, 2)->nullable()->after('amenities');
            $table->string('image_path')->nullable()->after('daily_rate');
            $table->boolean('is_available')->default(true)->after('image_path');
            $table->enum('type', ['v300d', 'v250d'])->after('is_available');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('vehicles', function (Blueprint $table) {
            $table->dropColumn([
                'name', 'model', 'description', 'seating_capacity', 'luggage_space',
                'amenities', 'daily_rate', 'image_path', 'is_available', 'type'
            ]);
        });
    }
};
