<?php

declare(strict_types=1);

namespace Plugin\tnt_international_phone\Migrations;

use JTL\Plugin\Migration;
use JTL\Update\IMigration;

/**
 * Removes the retired "Gesperrte Länder (Rufnummern)" setting (tnt_ip_blocked_countries).
 * The setting definition is dropped from info.xml as of 1.9.0; this cleans up the stored
 * value/definition rows so no orphaned config lingers after the update. Idempotent.
 */
class Migration20260731120000 extends Migration implements IMigration
{
    public function up()
    {
        $this->execute("DELETE FROM `tplugineinstellungen` WHERE `cName` = 'tnt_ip_blocked_countries'");
        $this->execute("DELETE FROM `tplugineinstellungenconf` WHERE `cWertName` = 'tnt_ip_blocked_countries'");
    }

    public function down()
    {
        // No-op: the setting is intentionally retired and not recreated on rollback.
    }
}
