<?php

declare(strict_types=1);

use App\Business\Product\ProductSkuCompatibilityService;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    public function up(): void
    {
        if (! Schema::hasTable('dberp_product_skus')) {
            return;
        }

        app(ProductSkuCompatibilityService::class)->runCompatibilityPass(false);
    }

    public function down(): void
    {
        // 数据兼容回填不可逆：不在此回滚业务数据。
    }
};
