<?php

/**
 * Migration 046 – Add accessibility audit widget setting
 */

use App\Database\Migration;

class AddAccessibilityAuditSetting extends Migration
{
    public function up(): void
    {
        $exists = $this->db->fetch("SELECT 1 FROM iw_settings WHERE setting_key = 'accessibility_audit_enabled'");
        if (!$exists) {
            $this->db->insert('iw_settings', [
                'setting_key'   => 'accessibility_audit_enabled',
                'setting_value' => '1',
                'setting_group' => 'features',
            ]);
        }
    }

    public function down(): void
    {
        $this->db->query("DELETE FROM iw_settings WHERE setting_key = 'accessibility_audit_enabled'");
    }
}
