<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;

return new class extends Migration
{
    public function up(): void
    {
        if (DB::getDriverName() === 'sqlite') {
            return;
        }

        DB::statement("ALTER TABLE navigation_menus MODIFY COLUMN position ENUM('header','mobile','sticky_bar','footer','top_bar') NOT NULL DEFAULT 'header'");
    }

    public function down(): void
    {
        if (DB::getDriverName() === 'sqlite') {
            return;
        }

        DB::statement("UPDATE navigation_menus SET position = 'header' WHERE position = 'top_bar'");
        DB::statement("ALTER TABLE navigation_menus MODIFY COLUMN position ENUM('header','mobile','sticky_bar','footer') NOT NULL DEFAULT 'header'");
    }
};
