CREATE TABLE IF NOT EXISTS `wecom_group_chats` (
  `chat_id` VARCHAR(128) NOT NULL,
  `name` VARCHAR(512) NOT NULL DEFAULT '',
  `owner_user_id` VARCHAR(128) NOT NULL,
  `member_count` INT NOT NULL DEFAULT 0,
  `status` INT NOT NULL DEFAULT 0,
  `synced_at` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  PRIMARY KEY (`chat_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- statement-breakpoint
CREATE TABLE IF NOT EXISTS `wecom_group_pushes` (
  `id` VARCHAR(64) NOT NULL,
  `task_id` VARCHAR(64) NOT NULL,
  `msgid` VARCHAR(128) NOT NULL DEFAULT '',
  `sender` VARCHAR(128) NOT NULL,
  `chat_ids` TEXT NOT NULL,
  `text_content` TEXT NOT NULL,
  `link_url` TEXT NOT NULL,
  `fail_list` TEXT NOT NULL,
  `created_at` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  PRIMARY KEY (`id`),
  KEY `wecom_group_pushes_task_idx` (`task_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
