<?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()
    {
        Schema::table('orders', function (Blueprint $table) {
            // Cek dulu, kalau belum ada baru buat
            if (!Schema::hasColumn('orders', 'receiver_name')) {
                $table->string('receiver_name')->nullable();
            }
            if (!Schema::hasColumn('orders', 'proof_image')) {
                $table->string('proof_image')->nullable();
            }
            if (!Schema::hasColumn('orders', 'delivered_at')) {
                $table->timestamp('delivered_at')->nullable();
            }
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('orders', function (Blueprint $table) {
            //
        });
    }
};
