<?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('banner', function (Blueprint $table) {
            if (!Schema::hasColumn('banner', 'side_banner_one')) {
                $table->string('side_banner_one')->nullable()->after('banner_two');
            }
            if (!Schema::hasColumn('banner', 'side_banner_two')) {
                $table->string('side_banner_two')->nullable()->after('side_banner_one');
            }
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('banner', function (Blueprint $table) {
            $table->dropColumn(['side_banner_one', 'side_banner_two']);
        });
    }
};
