<?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 (['basket_info', 'members_info', 'order_info'] as $table) {
            if (Schema::hasColumn($table, 'multisite__site_id')) {
                Schema::table($table, function (Blueprint $t) {
                    $t->dropColumn('multisite__site_id');
                });
            }
        }
        Schema::dropIfExists('multisite__custom_entities');
        Schema::dropIfExists('multisite__base_entities');
        Schema::dropIfExists('multisite__sites');
    }

    public function down(): void
    {
        // no-op: multisite plugin removed, down migration not supported
    }
};
