<?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('orders', function (Blueprint $table) {
            $table->string('currency')->nullable()->after('payment_method');
            $table->string('country')->nullable()->after('currency');
            $table->string('street_address')->nullable()->after('country');
            $table->string('city')->nullable()->after('street_address');
            $table->string('state')->nullable()->after('city');
            $table->string('zip')->nullable()->after('state');
        });

        Schema::table('transactions', function (Blueprint $table) {
            $table->string('provider')->nullable()->after('payment_method');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('orders', function (Blueprint $table) {
            $table->dropColumn(['currency', 'country', 'street_address', 'city', 'state', 'zip']);
        });

        Schema::table('transactions', function (Blueprint $table) {
            $table->dropColumn(['provider']);
        });
    }
};
