<?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
    {
        if (!Schema::hasColumn('resources', 'vehicle_registration_document')) {
            Schema::table('resources', function (Blueprint $table) {
                // Araç ruhsatı (jpg/png/webp/pdf) dosya yolu
                $table->string('vehicle_registration_document')->nullable()->after('vehicle_fuel_consumption');
            });
        }
    }

    public function down(): void
    {
        if (Schema::hasColumn('resources', 'vehicle_registration_document')) {
            Schema::table('resources', function (Blueprint $table) {
                $table->dropColumn('vehicle_registration_document');
            });
        }
    }
};
