-- Queues picklist table (synced from Autotask Ticket.queueID field)
CREATE TABLE IF NOT EXISTS queues (
    value INTEGER PRIMARY KEY,
    label VARCHAR(200) NOT NULL,
    is_active BOOLEAN DEFAULT true,
    is_system BOOLEAN DEFAULT false,
    sort_order INTEGER,
    parent_value INTEGER,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    synced_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    is_deleted BOOLEAN DEFAULT false,
    deleted_at TIMESTAMP
);

CREATE INDEX IF NOT EXISTS idx_queues_is_active ON queues (is_active);
