-- 龙虾渠道插件配置表（即插即用多IM通道）
CREATE TABLE IF NOT EXISTS lobster_channel_plugin_config (
  id            BIGINT AUTO_INCREMENT PRIMARY KEY,
  company_id    BIGINT       NOT NULL COMMENT '租户ID',
  channel_type  VARCHAR(30)  NOT NULL COMMENT '渠道类型: QW/WX/IM/WHATSAPP/LINE/TELEGRAM/APP_IM/DOUYIN_DM/KUAISHOU_DM/XIAOHONGSHU_DM/TMALL/JD/OTHER',
  enabled       TINYINT      DEFAULT 0 COMMENT '是否启用: 0-禁用 1-启用',
  config_json   TEXT         COMMENT '渠道配置JSON(API Key/Webhook URL/Token/phoneNumberId等)',
  create_time   DATETIME     DEFAULT CURRENT_TIMESTAMP,
  update_time   DATETIME     DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  UNIQUE KEY uk_company_channel (company_id, channel_type)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='龙虾渠道插件配置表(即插即用多IM通道)';
