2020-07-06 08:33:35 +00:00
|
|
|
create database if not exists `intimate_extractor`;
|
|
|
|
use intimate_extractor;
|
|
|
|
|
2020-07-17 10:21:38 +00:00
|
|
|
CREATE TABLE IF NOT EXISTS `streamer` (
|
2020-07-10 08:13:08 +00:00
|
|
|
`uid` bigint AUTO_INCREMENT,
|
2020-07-07 08:17:05 +00:00
|
|
|
`platform` varchar(255) NOT NULL,
|
2020-07-17 10:21:38 +00:00
|
|
|
`user_id` varchar(255) NOT NULL,
|
|
|
|
`user_name` varchar(255) NOT NULL,
|
2020-07-09 09:09:46 +00:00
|
|
|
`live_url` text,
|
2020-07-07 08:17:05 +00:00
|
|
|
`channel` varchar(128) DEFAULT NULL,
|
2020-07-17 10:21:38 +00:00
|
|
|
`latest_log_uid` bigint,
|
2020-07-10 08:13:08 +00:00
|
|
|
`ext` json DEFAULT NULL,
|
2020-07-17 10:21:38 +00:00
|
|
|
`update_time` Timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
2020-07-07 08:17:05 +00:00
|
|
|
PRIMARY KEY (`uid`),
|
2020-07-17 10:21:38 +00:00
|
|
|
UNIQUE KEY `platform_anchor_id_idx` (`platform`, `user_id`),
|
2020-07-07 08:17:05 +00:00
|
|
|
KEY `platform_idx` (`platform`),
|
2020-07-17 10:21:38 +00:00
|
|
|
KEY `user_id_idx` (`user_id`),
|
|
|
|
KEY `user_name_idx` (`user_name`),
|
2020-07-06 08:33:35 +00:00
|
|
|
KEY `channel_idx` (`channel`),
|
|
|
|
KEY `update_time_idx` (`update_time`)
|
|
|
|
);
|
|
|
|
|
2020-07-10 08:13:08 +00:00
|
|
|
CREATE TABLE IF NOT EXISTS `collect_log` (
|
2020-07-17 10:21:38 +00:00
|
|
|
`log_uid` bigint AUTO_INCREMENT,
|
|
|
|
`streamer_uid` bigint,
|
2020-07-06 08:33:35 +00:00
|
|
|
`platform` varchar(255) NOT NULL,
|
2020-07-17 10:21:38 +00:00
|
|
|
`user_id` varchar(255) NOT NULL,
|
2020-07-06 08:33:35 +00:00
|
|
|
|
2020-07-16 07:25:55 +00:00
|
|
|
`is_live_streaming` tinyint(1) DEFAULT 0,
|
2020-07-10 08:13:08 +00:00
|
|
|
`is_error` tinyint(1) DEFAULT 0,
|
2020-07-07 08:17:05 +00:00
|
|
|
|
2020-07-14 11:00:34 +00:00
|
|
|
`followers` bigint(11) DEFAULT NULL,
|
|
|
|
`views` bigint(11) DEFAULT NULL,
|
2020-07-06 08:33:35 +00:00
|
|
|
`giver` json DEFAULT NULL,
|
2020-07-14 11:00:34 +00:00
|
|
|
`gratuity` bigint(11) DEFAULT NULL,
|
2020-07-06 08:33:35 +00:00
|
|
|
|
2020-07-16 07:25:55 +00:00
|
|
|
`live_title` text DEFAULT NULL,
|
2020-07-17 10:21:38 +00:00
|
|
|
`live_start_time` Timestamp NULL DEFAULT NULL,
|
|
|
|
`live_end_time` Timestamp NULL DEFAULT NULL,
|
|
|
|
`update_time` Timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
2020-07-15 11:23:45 +00:00
|
|
|
`tags` json DEFAULT NULL,
|
2020-07-06 08:33:35 +00:00
|
|
|
`ext` json DEFAULT NULL,
|
2020-07-07 08:17:05 +00:00
|
|
|
|
2020-07-10 10:31:17 +00:00
|
|
|
`error_msg` text DEFAULT NULL,
|
2020-07-06 08:33:35 +00:00
|
|
|
|
2020-07-17 10:21:38 +00:00
|
|
|
PRIMARY KEY (`log_uid`),
|
|
|
|
KEY `streamer_uid_idx` (`streamer_uid`),
|
2020-07-06 08:33:35 +00:00
|
|
|
KEY `platform_idx` (`platform`),
|
2020-07-17 10:21:38 +00:00
|
|
|
KEY `user_id_idx` (`user_id`),
|
2020-07-16 07:25:55 +00:00
|
|
|
KEY `is_live_streaming_idx` (`is_live_streaming`),
|
2020-07-07 08:17:05 +00:00
|
|
|
KEY `is_error_idx` (`is_error`),
|
2020-07-06 08:33:35 +00:00
|
|
|
KEY `followers_idx` (`followers`),
|
|
|
|
KEY `views_idx` (`views`),
|
|
|
|
KEY `gratuity_idx` (`gratuity`),
|
|
|
|
KEY `update_time_idx` (`update_time`)
|
|
|
|
)
|