<?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('properties', function (Blueprint $table) {
            // 👇 Paste kode kamu di sini
            $table->string('slug')->nullable()->after('prop_name');
            $table->string('seo_title')->nullable();
            $table->text('seo_description')->nullable();
            $table->string('seo_og_image')->nullable();
            $table->string('seo_canonical')->nullable();
            $table->string('seo_robots')->default('index,follow');
        });
    }

    public function down(): void
    {
        Schema::table('properties', function (Blueprint $table) {
            // 🔁 Drop kolom dalam urutan terbalik (best practice)
            $table->dropColumn([
                'seo_robots',
                'seo_canonical',
                'seo_og_image',
                'seo_description',
                'seo_title',
                'slug',
            ]);
        });
    }
};