-- ============================================================
-- Migration 012: Bloqueio apos abertura ativa do WhatsApp
-- Tabela: whatsapp_chat_atribuicoes
-- ============================================================

ALTER TABLE whatsapp_chat_atribuicoes
  ADD COLUMN IF NOT EXISTS awaiting_customer_reply BOOLEAN NOT NULL DEFAULT FALSE;

CREATE INDEX IF NOT EXISTS idx_whatsapp_atribuicoes_awaiting_customer_reply
  ON whatsapp_chat_atribuicoes (awaiting_customer_reply, status);
