<?php
declare(strict_types=1);
// ==================================================
// Nuclear Fancy Pants Edition™ -- NUCLEAR+++
// File: /home/ploi/automarketer-ai.com/public/wp-content/plugins/automarketer-ai/migrations/042_gap_topic_queue.php
// Description: Migration 042 -- create wp_amai_gap_topic_queue table - NUCLEAR+++
// Last Edited: 2026-05-18
// ==================================================

namespace AutoMarketerAI\Migrations;

defined('ABSPATH') || exit;

class Migration_042_GapTopicQueue
{
    public function up(): void
    {
        global $wpdb;
        $table      = $wpdb->prefix . 'amai_gap_topic_queue';
        $charset    = $wpdb->get_charset_collate();

        $wpdb->query(
            "CREATE TABLE IF NOT EXISTS `{$table}` (
                `id`              BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
                `topic`           VARCHAR(500)    NOT NULL,
                `competitor_url`  VARCHAR(2000)   NOT NULL DEFAULT '',
                `queued_at`       DATETIME        NOT NULL,
                `created_at`      DATETIME        NOT NULL,
                PRIMARY KEY (`id`)
            ) {$charset};"
        );
    }
}