-- External Broadcaster integration: idempotency log for callback batches
-- Run: mysql -u kadrum_admin -p dev_kadrum < migrations/20260419_broadcaster_integration.sql

CREATE TABLE IF NOT EXISTS broadcaster_batch_log (
    batch_id VARCHAR(36) PRIMARY KEY,
    broadcast_id VARCHAR(64) NOT NULL,
    broadcast_code VARCHAR(128) NOT NULL DEFAULT '',
    processed_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    results_count INT NOT NULL DEFAULT 0,
    INDEX idx_broadcast_id (broadcast_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
