-- SQL table definition
-- Generated from splitting a larger SQL file
-- Table: ai_authors
--

CREATE TABLE `ai_authors` (
  `id` int NOT NULL AUTO_INCREMENT,
  `author_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `app_id` varchar(127) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `app_token` varchar(127) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `department_id` int NOT NULL DEFAULT '0',
  `department_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `department` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
  `title` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `hospital` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `specialty` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `toutiao_cookie` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `toutiao_images_cookie` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `introduction` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `avatar_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `cumulative_published_count` int DEFAULT '0' COMMENT '累计发文量（从起始日到stat_date的总和）',
  `cumulative_revenue_sum` int DEFAULT '0' COMMENT '累计收入（从起始日到stat_date的总和）',
  `status` enum('active','inactive') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'active',
  `channel` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1=baidu|2=toutiao|3=weixin',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_ai_authors_status` (`status`),
  KEY `idx_ai_authors_status_id` (`status`,`id`),
  KEY `idx_ai_authors_department_id` (`department_id`)
) ENGINE=InnoDB AUTO_INCREMENT=392 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
