<?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
    {
        foreach (['products', 'categories', 'content_pages'] as $tableName) {
            Schema::table($tableName, function (Blueprint $table): void {
                $table->string('meta_title')->nullable();
                $table->text('meta_description')->nullable();
                $table->string('og_image_path')->nullable();
            });
        }
    }

    public function down(): void
    {
        foreach (['products', 'categories', 'content_pages'] as $tableName) {
            Schema::table($tableName, function (Blueprint $table): void {
                $table->dropColumn(['meta_title', 'meta_description', 'og_image_path']);
            });
        }
    }
};
