-- Add support ticket fields to chat_conversations

START TRANSACTION;

ALTER TABLE `chat_conversations`
  ADD COLUMN IF NOT EXISTS `target_group` VARCHAR(20) NULL AFTER `created_by`,
  ADD COLUMN IF NOT EXISTS `claimed_by` INT NULL AFTER `target_group`,
  ADD COLUMN IF NOT EXISTS `claimed_at` TIMESTAMP NULL AFTER `claimed_by`;

CREATE INDEX IF NOT EXISTS `idx_cc_target_group` ON `chat_conversations` (`target_group`);
CREATE INDEX IF NOT EXISTS `idx_cc_claimed_by` ON `chat_conversations` (`claimed_by`);

COMMIT;
