迁移目录
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
-- 爬虫错误日志表
|
||||
CREATE TABLE IF NOT EXISTS `la_crawl_error_log` (
|
||||
`id` BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
|
||||
`task_name` VARCHAR(100) NOT NULL DEFAULT '' COMMENT '任务名称(schedule/standings/match_finish等)',
|
||||
`request_url` VARCHAR(1000) NOT NULL DEFAULT '' COMMENT '请求URL',
|
||||
`request_method` VARCHAR(10) NOT NULL DEFAULT 'GET' COMMENT '请求方法',
|
||||
`request_params` TEXT COMMENT '请求参数(JSON)',
|
||||
`http_status` INT NOT NULL DEFAULT 0 COMMENT 'HTTP状态码(0=网络异常)',
|
||||
`error_type` VARCHAR(100) NOT NULL DEFAULT '' COMMENT '错误类型(NetworkError/404/timeout等)',
|
||||
`error_message` TEXT COMMENT '错误信息',
|
||||
`response_body` TEXT COMMENT '响应内容(截断)',
|
||||
`channel` VARCHAR(20) NOT NULL DEFAULT '' COMMENT '请求通道(api/tls/playwright/page)',
|
||||
`notified` TINYINT NOT NULL DEFAULT 0 COMMENT '是否已发送邮件通知(0=未通知,1=已通知)',
|
||||
`created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
KEY `idx_notified` (`notified`),
|
||||
KEY `idx_task_created` (`task_name`, `created_at`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='爬虫请求错误日志';
|
||||
|
||||
-- 定时任务:错误报告邮件(每5分钟)
|
||||
INSERT INTO `la_dev_crontab` (`name`, `type`, `command`, `params`, `status`, `expression`, `create_time`, `update_time`)
|
||||
VALUES ('爬虫错误报告邮件', 1, 'crawler', 'error_report', 1, '*/5 * * * *', UNIX_TIMESTAMP(), UNIX_TIMESTAMP());
|
||||
@@ -0,0 +1,20 @@
|
||||
CREATE TABLE IF NOT EXISTS `la_lottery_draw_result` (
|
||||
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
|
||||
`code` varchar(30) NOT NULL DEFAULT '' COMMENT '彩种编码(关联la_lottery_game.code)',
|
||||
`issue` varchar(30) NOT NULL DEFAULT '' COMMENT '期号',
|
||||
`draw_time` datetime DEFAULT NULL COMMENT '开奖时间',
|
||||
`draw_code` varchar(255) NOT NULL DEFAULT '' COMMENT '开奖号码(逗号分隔)',
|
||||
`draw_ext` varchar(500) NOT NULL DEFAULT '' COMMENT '扩展号码(台湾宾果等)',
|
||||
`status` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '开奖状态 1已开奖 4停售等',
|
||||
`idx` int unsigned NOT NULL DEFAULT 0 COMMENT '当日期数索引(index)',
|
||||
`next_issue` varchar(30) NOT NULL DEFAULT '' COMMENT '下期期号',
|
||||
`next_time` datetime DEFAULT NULL COMMENT '下期开奖时间',
|
||||
`trend` json DEFAULT NULL COMMENT '走势数据(JSON)',
|
||||
`s_time` datetime DEFAULT NULL COMMENT '数据同步时间(API sTime)',
|
||||
`create_time` int unsigned NOT NULL DEFAULT 0,
|
||||
`update_time` int unsigned NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_code_issue` (`code`, `issue`),
|
||||
KEY `idx_code_draw_time` (`code`, `draw_time`),
|
||||
KEY `idx_draw_time` (`draw_time`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='彩种开奖结果表';
|
||||
@@ -0,0 +1,2 @@
|
||||
INSERT INTO `la_dev_crontab` (`name`, `type`, `command`, `params`, `status`, `expression`, `create_time`, `update_time`)
|
||||
VALUES ('超时比赛收尾', 1, 'crawler', 'match_finish', 1, '*/1 * * * *', UNIX_TIMESTAMP(), UNIX_TIMESTAMP());
|
||||
Reference in New Issue
Block a user