<?php

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

return new class extends Migration
{
    public function up(): void
    {
        if (Schema::hasTable('menues_roles') && ! Schema::hasTable('roles_menues')) {
            Schema::rename('menues_roles', 'roles_menues');
        }
    }

    public function down(): void
    {
        if (Schema::hasTable('roles_menues') && ! Schema::hasTable('menues_roles')) {
            Schema::rename('roles_menues', 'menues_roles');
        }
    }
};
