<?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::table('inquiries', function (Blueprint $table) {
            $table->string('street')->nullable()->after('phone');
            $table->string('street_number', 30)->nullable()->after('street');
            $table->string('postal_code', 20)->nullable()->after('street_number');
            $table->string('city')->nullable()->after('postal_code');
            $table->json('configuration')->nullable()->after('topics');
            $table->timestamp('customer_copy_sent_at')->nullable()->after('consent_at');
        });
    }

    public function down(): void
    {
        Schema::table('inquiries', function (Blueprint $table) {
            $table->dropColumn(['street', 'street_number', 'postal_code', 'city', 'configuration', 'customer_copy_sent_at']);
        });
    }
};
