<?php
declare(strict_types=1);
// ==================================================
// Nuclear Fancy Pants Edition™ — NUCLEAR+++
// File: /migrations/017_generation_batch_width.php
// Description: Widens generation_batch column to varchar(32) to accommodate manual post batch keys - NUCLEAR+++
// Last Edited: 2026-04-18
// ==================================================
namespace AutoMarketerAI\Migrations;
// No direct access
defined('ABSPATH') || exit;
final class Migration_017_GenerationBatchWidth
{
    // Migration version identifier -- never change once shipped
    public const VERSION = '017';
    public const DESCRIPTION = 'Widen generation_batch column to varchar(32)';
    public function up(): void
    {
        global $wpdb;
        $table = $wpdb->prefix . 'amai_scheduled_posts';
        // DDL auto-commits in MySQL -- no transaction wrapper needed
        $wpdb->query("ALTER TABLE {$table} MODIFY COLUMN generation_batch VARCHAR(32) NOT NULL");
    }
    public function down(): void
    {
        // Forward-only migrations -- down() documents intent only.
        // Never call this in production.
        // To rollback: ALTER TABLE {prefix}amai_scheduled_posts MODIFY COLUMN generation_batch VARCHAR(10) NOT NULL;
    }
}