-- TeamTasks: Centralized task tracker for all bots
-- Run against payfrit_dev (and later payfrit prod)

CREATE TABLE IF NOT EXISTS TeamTasks (
    ID          INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    BotName     VARCHAR(50) NOT NULL,
    Title       VARCHAR(255) NOT NULL,
    Status      ENUM('active','paused','done','cancelled') NOT NULL DEFAULT 'active',
    Channel     VARCHAR(100) DEFAULT NULL,
    StartedOn   DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PausedOn    DATETIME DEFAULT NULL,
    CompletedOn DATETIME DEFAULT NULL,
    Notes       TEXT DEFAULT NULL,
    AssignedBy  VARCHAR(50) DEFAULT NULL,
    INDEX idx_status (Status),
    INDEX idx_botname (BotName)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
