<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    public function up()
    {
        Schema::table('contact_us', function (Blueprint $table) {
            $table->dropColumn(['purpose', 'message']); // Remove old columns
            $table->string('property_name')->nullable()->before('number'); // Add new column
        });
    }

    public function down()
    {
        Schema::table('contact_us', function (Blueprint $table) {
            $table->string('purpose')->nullable(); // Re-add if rollback
            $table->text('message')->nullable();
            $table->dropColumn('property_name'); // Remove new column on rollback
        });
    }
};
