-- ============================================================
-- Migration: Add TTM_ACTIVE and TTM_ROLE columns to users table
-- TTM_ACTIVE: toggle for TTM participation
-- TTM_ROLE: PA (Process Associate) or TL (Team Lead) — only for employee role
-- ============================================================

ALTER TABLE users
  ADD COLUMN IF NOT EXISTS TTM_ACTIVE tinyint(1) NOT NULL DEFAULT 0
    COMMENT '1 = user participates in TTM system'
  AFTER CRM_ACTIVE;

ALTER TABLE users
  ADD COLUMN IF NOT EXISTS TTM_ROLE varchar(20) DEFAULT NULL
    COMMENT 'PA = Process Associate, TL = Team Lead (only when TTM_ACTIVE=1 and ROLE=employee)'
  AFTER TTM_ACTIVE;
