/*
 Navicat Premium Data Transfer

 Source Server         : mysql-210
 Source Server Type    : MySQL
 Source Server Version : 50732
 Source Host           : 192.168.0.149:3306
 Source Schema         : tnb_content_rdb

 Target Server Type    : MySQL
 Target Server Version : 50732
 File Encoding         : 65001

 Date: 15/01/2026 15:44:39
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for blog_about_view
-- ----------------------------
DROP TABLE IF EXISTS `blog_about_view`;
CREATE TABLE `blog_about_view` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `create_time` datetime(6) NOT NULL,
  `deleted` bit(1) NOT NULL,
  `update_time` datetime(6) NOT NULL,
  `content` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
  `title` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

-- ----------------------------
-- Table structure for blog_article
-- ----------------------------
DROP TABLE IF EXISTS `blog_article`;
CREATE TABLE `blog_article` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `create_time` datetime(6) NOT NULL,
  `deleted` bit(1) NOT NULL,
  `update_time` datetime(6) NOT NULL,
  `article_id` varchar(255) NOT NULL,
  `category_id` int(11) NOT NULL,
  `content` text NOT NULL,
  `editor` varchar(255) NOT NULL,
  `excerpt` varchar(255) NOT NULL,
  `publish_at` datetime(6) NOT NULL,
  `published` bit(1) NOT NULL,
  `title` varchar(255) NOT NULL,
  `owner` bigint(20) DEFAULT NULL,
  `owner_id` int(11) DEFAULT NULL,
  `weight` int(11) DEFAULT NULL,
  `post_type` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UK_7a346qtf7s4mi59cq6eq3bgoe` (`article_id`),
  KEY `FKnji2jikxh7lkxhgoadgesxpct` (`owner_id`),
  CONSTRAINT `FKnji2jikxh7lkxhgoadgesxpct` FOREIGN KEY (`owner_id`) REFERENCES `sys_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Table structure for blog_article_tag
-- ----------------------------
DROP TABLE IF EXISTS `blog_article_tag`;
CREATE TABLE `blog_article_tag` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `create_time` datetime(6) NOT NULL,
  `deleted` bit(1) NOT NULL,
  `update_time` datetime(6) NOT NULL,
  `article_id` varchar(255) NOT NULL,
  `tag_id` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `article_id` (`article_id`,`tag_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Table structure for blog_article_view
-- ----------------------------
DROP TABLE IF EXISTS `blog_article_view`;
CREATE TABLE `blog_article_view` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `create_time` datetime(6) NOT NULL,
  `deleted` bit(1) NOT NULL,
  `update_time` datetime(6) NOT NULL,
  `article_id` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
  `request_id` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
  `session_id` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

-- ----------------------------
-- Table structure for blog_category
-- ----------------------------
DROP TABLE IF EXISTS `blog_category`;
CREATE TABLE `blog_category` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `create_time` datetime(6) NOT NULL,
  `deleted` bit(1) NOT NULL,
  `update_time` datetime(6) NOT NULL,
  `name` varchar(255) NOT NULL,
  `type` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UK_46ccwnsi9409t36lurvtyljak` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Table structure for blog_question
-- ----------------------------
DROP TABLE IF EXISTS `blog_question`;
CREATE TABLE `blog_question` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `create_time` datetime(6) NOT NULL,
  `deleted` bit(1) NOT NULL,
  `update_time` datetime(6) NOT NULL,
  `category_id` int(11) NOT NULL,
  `content` text COLLATE utf8mb4_bin,
  `owner` bigint(20) DEFAULT NULL,
  `publish_at` datetime(6) NOT NULL,
  `question_id` varchar(255) COLLATE utf8mb4_bin NOT NULL,
  `tag` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
  `title` varchar(255) COLLATE utf8mb4_bin NOT NULL,
  `weight` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UK_4r5x0ds8h0pv2hxoy7bbe0miq` (`question_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

-- ----------------------------
-- Table structure for blog_question1
-- ----------------------------
DROP TABLE IF EXISTS `blog_question1`;
CREATE TABLE `blog_question1` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `create_time` datetime(6) NOT NULL,
  `deleted` bit(1) NOT NULL,
  `update_time` datetime(6) NOT NULL,
  `category_id` int(11) NOT NULL,
  `content` text,
  `publish_at` datetime(6) NOT NULL,
  `question_id` varchar(255) NOT NULL,
  `tag` varchar(255) DEFAULT NULL,
  `title` varchar(255) NOT NULL,
  `owner` bigint(20) DEFAULT NULL,
  `owner_id` int(11) DEFAULT NULL,
  `weight` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UK_488pr2mfs6ye2bjlwf0pbcynf` (`question_id`),
  KEY `FKruq0rciiv2u9do75lmxrniv2c` (`owner_id`),
  CONSTRAINT `FKruq0rciiv2u9do75lmxrniv2c` FOREIGN KEY (`owner_id`) REFERENCES `sys_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Table structure for disk_album
-- ----------------------------
DROP TABLE IF EXISTS `disk_album`;
CREATE TABLE `disk_album` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  `create_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  `update_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  `album_id` bigint(20) NOT NULL,
  `album_name` varchar(255) NOT NULL,
  `file_type` int(11) NOT NULL,
  `cover_file_id` varchar(255) NOT NULL,
  `num` int(11) NOT NULL,
  `create_at` bigint(20) NOT NULL,
  `create_by` bigint(20) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UK_rfuvf3osnlaakifjdao0a8e2x` (`album_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='网盘相册';

-- ----------------------------
-- Table structure for disk_album_file
-- ----------------------------
DROP TABLE IF EXISTS `disk_album_file`;
CREATE TABLE `disk_album_file` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `album_id` bigint(20) NOT NULL,
  `sha256sum` varchar(255) NOT NULL,
  `pos` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `album_id` (`album_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='网盘相册中的文件';

-- ----------------------------
-- Table structure for disk_cam_device
-- ----------------------------
DROP TABLE IF EXISTS `disk_cam_device`;
CREATE TABLE `disk_cam_device` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `deleted` bit(1) NOT NULL DEFAULT b'0',
  `create_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  `update_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  `cam_id` bigint(20) NOT NULL,
  `cam_name` varchar(255) NOT NULL,
  `state` int(11) NOT NULL,
  `add_at` datetime(6) NOT NULL,
  `add_by` bigint(20) NOT NULL,
  `push_url` varchar(255) DEFAULT NULL,
  `pull_url` varchar(255) DEFAULT NULL,
  `device_id` varchar(255) DEFAULT NULL,
  `online` bit(1) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `favlist_id` (`cam_id`),
  UNIQUE KEY `UK_s2qsleagsnky42h7gomb5lmf9` (`device_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='摄像头';

-- ----------------------------
-- Table structure for disk_cam_record
-- ----------------------------
DROP TABLE IF EXISTS `disk_cam_record`;
CREATE TABLE `disk_cam_record` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `deleted` bit(1) NOT NULL DEFAULT b'0',
  `create_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  `update_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  `cam_id` bigint(20) NOT NULL,
  `record_id` bigint(20) NOT NULL,
  `video_file_id` varchar(255) NOT NULL COMMENT 'object_id',
  `cover_url` varchar(255) DEFAULT NULL,
  `start_at` datetime(6) NOT NULL,
  `duration` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `record_id` (`record_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='摄像头录像记录';

-- ----------------------------
-- Table structure for disk_file
-- ----------------------------
DROP TABLE IF EXISTS `disk_file`;
CREATE TABLE `disk_file` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `create_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  `deleted` bit(1) NOT NULL DEFAULT b'0',
  `update_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  `channel_code` int(11) NOT NULL,
  `file_id` varchar(255) NOT NULL COMMENT 'oss 的 object_id',
  `pid` varchar(255) NOT NULL,
  `path` varchar(255) NOT NULL,
  `filename` varchar(255) NOT NULL,
  `file_type` int(11) NOT NULL,
  `sha256sum` varchar(255) NOT NULL,
  `size` bigint(20) NOT NULL,
  `owner` bigint(20) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UK_db0vg67wc61jnlo7nesm0ulbg` (`file_id`) USING BTREE,
  KEY `path` (`path`),
  KEY `sha256sum` (`sha256sum`),
  KEY `owner` (`owner`),
  KEY `file_type` (`file_type`),
  KEY `pid` (`pid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='网盘文件';

-- ----------------------------
-- Table structure for disk_share
-- ----------------------------
DROP TABLE IF EXISTS `disk_share`;
CREATE TABLE `disk_share` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  `create_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  `update_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  `share_id` bigint(20) NOT NULL,
  `album_type` int(11) NOT NULL,
  `album_id` bigint(20) NOT NULL,
  `create_at` bigint(20) NOT NULL,
  `create_by` bigint(20) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UK_rfuvf3osnlaakifjdao0a8e2x` (`share_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='网盘分享';

-- ----------------------------
-- Table structure for disk_share_to
-- ----------------------------
DROP TABLE IF EXISTS `disk_share_to`;
CREATE TABLE `disk_share_to` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `share_id` bigint(20) NOT NULL,
  `user_id` bigint(20) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `UK_rfuvf3osnlaakifjdao0a8e2x` (`share_id`) USING BTREE,
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='网盘被分享用户';

-- ----------------------------
-- Table structure for disk_user_activity
-- ----------------------------
DROP TABLE IF EXISTS `disk_user_activity`;
CREATE TABLE `disk_user_activity` (
  `id` varchar(255) COLLATE utf8mb4_bin NOT NULL,
  `activity` int(11) DEFAULT NULL,
  `create_time` datetime(6) DEFAULT NULL,
  `create_by` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='用户活动';

-- ----------------------------
-- Table structure for file_job_detail
-- ----------------------------
DROP TABLE IF EXISTS `file_job_detail`;
CREATE TABLE `file_job_detail` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `deleted` bit(1) NOT NULL DEFAULT b'0',
  `create_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  `update_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  `job_id` bigint(20) NOT NULL,
  `job_name` varchar(255) NOT NULL,
  `status` int(11) NOT NULL,
  `start_at` datetime(6) NOT NULL,
  `end_at` datetime(6) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `oss_type` (`job_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='任务详情';

-- ----------------------------
-- Table structure for file_local_file
-- ----------------------------
DROP TABLE IF EXISTS `file_local_file`;
CREATE TABLE `file_local_file` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `deleted` bit(1) NOT NULL,
  `create_time` datetime(6) NOT NULL,
  `update_time` datetime(6) NOT NULL,
  `object_name` varchar(255) NOT NULL,
  `object_id` varchar(255) NOT NULL,
  `absolute_path` varchar(255) NOT NULL,
  `sha256sum` varchar(255) NOT NULL,
  `filename` varchar(255) NOT NULL,
  `content_type` varchar(255) NOT NULL,
  `file_type` int(11) NOT NULL,
  `size` bigint(20) NOT NULL,
  `owner` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UK_db0vg67wc61jnlo7nesm0ulbg` (`object_id`),
  UNIQUE KEY `UK_iyqdutum15wj3lc4u15dakbs2` (`object_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Table structure for file_store_node
-- ----------------------------
DROP TABLE IF EXISTS `file_store_node`;
CREATE TABLE `file_store_node` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `create_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  `deleted` bit(1) NOT NULL DEFAULT b'0',
  `update_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  `node_addr` varchar(255) NOT NULL,
  `http_port` int(11) NOT NULL,
  `rpc_port` int(11) NOT NULL,
  `enabled` bit(1) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UK_1wxd94v6bxoaaxci2c9plth54` (`node_addr`,`http_port`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Table structure for file_store_volume
-- ----------------------------
DROP TABLE IF EXISTS `file_store_volume`;
CREATE TABLE `file_store_volume` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `store_dir` varchar(255) NOT NULL,
  `store_node_id` int(11) NOT NULL,
  `name` varchar(255) NOT NULL,
  `volume` varchar(255) NOT NULL,
  `mount_point` varchar(255) NOT NULL,
  `fs_type` varchar(255) NOT NULL,
  `block_id` varchar(255) NOT NULL,
  `total_space` bigint(20) NOT NULL,
  `avail_space` bigint(20) NOT NULL,
  `total_inode` bigint(20) NOT NULL,
  `avail_inode` bigint(20) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `FK1kcrqmowoyk62q46kslo9bh9f` (`store_node_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Table structure for file_upload_channel
-- ----------------------------
DROP TABLE IF EXISTS `file_upload_channel`;
CREATE TABLE `file_upload_channel` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `create_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  `deleted` bit(1) NOT NULL DEFAULT b'0',
  `update_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  `user_node_id` int(11) NOT NULL,
  `channel_code` int(11) NOT NULL,
  `name` varchar(255) NOT NULL,
  `prefix` varchar(255) NOT NULL,
  `max_size` bigint(20) NOT NULL,
  `file_type` int(11) NOT NULL,
  `scope` int(11) NOT NULL,
  `set_url` bit(1) NOT NULL,
  `set_callback` bit(1) NOT NULL,
  `enabled` bit(1) NOT NULL,
  `create_by` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `prefix` (`prefix`,`user_node_id`) USING BTREE,
  UNIQUE KEY `user_node_id` (`user_node_id`,`channel_code`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Table structure for file_user_key
-- ----------------------------
DROP TABLE IF EXISTS `file_user_key`;
CREATE TABLE `file_user_key` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `create_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  `deleted` bit(1) NOT NULL DEFAULT b'0',
  `update_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  `access_key_id` varchar(255) NOT NULL,
  `access_key_secret` varchar(255) NOT NULL,
  `create_by` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UK_b19uph22ddqmlfck521k6yao5` (`access_key_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Table structure for file_user_node
-- ----------------------------
DROP TABLE IF EXISTS `file_user_node`;
CREATE TABLE `file_user_node` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `create_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  `deleted` bit(1) NOT NULL DEFAULT b'0',
  `update_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  `store_node_id` int(11) NOT NULL,
  `domain` varchar(255) NOT NULL,
  `protocol` varchar(255) NOT NULL,
  `referer` varchar(255) NOT NULL,
  `secret_key` varchar(255) NOT NULL,
  `create_by` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `domain` (`domain`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Table structure for search_wenshu_doc
-- ----------------------------
DROP TABLE IF EXISTS `search_wenshu_doc`;
CREATE TABLE `search_wenshu_doc` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `create_time` datetime(6) NOT NULL,
  `deleted` bit(1) NOT NULL,
  `update_time` datetime(6) NOT NULL,
  `case_id` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
  `case_name` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
  `case_type` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
  `case_type_id` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
  `cause` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
  `court` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
  `judgment_date` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
  `original_url` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
  `parties` text COLLATE utf8mb4_bin,
  `procedures` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
  `public_date` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
  `region` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
  `wenshu_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UK_63xcr8vbrobc2wpauyptej0d` (`wenshu_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

-- ----------------------------
-- Table structure for search_wenshu_legals
-- ----------------------------
DROP TABLE IF EXISTS `search_wenshu_legals`;
CREATE TABLE `search_wenshu_legals` (
  `wenshu_doc_id` int(11) NOT NULL,
  `legal_basis` text COLLATE utf8mb4_bin,
  KEY `FK3j21a8x2jltc4obypgjcblgox` (`wenshu_doc_id`),
  CONSTRAINT `FK3j21a8x2jltc4obypgjcblgox` FOREIGN KEY (`wenshu_doc_id`) REFERENCES `search_wenshu_doc` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

-- ----------------------------
-- Table structure for vod_banner_video
-- ----------------------------
DROP TABLE IF EXISTS `vod_banner_video`;
CREATE TABLE `vod_banner_video` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `deleted` bit(1) NOT NULL DEFAULT b'0',
  `create_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  `update_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  `create_at` bigint(20) NOT NULL,
  `video_id` varchar(255) CHARACTER SET utf8mb4 NOT NULL,
  `title` varchar(255) COLLATE utf8mb4_bin NOT NULL,
  `cover_url` varchar(255) COLLATE utf8mb4_bin NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UK_rfuvf3osnlaakifjdao0a8e2x` (`cover_url`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

-- ----------------------------
-- Table structure for vod_play_complete
-- ----------------------------
DROP TABLE IF EXISTS `vod_play_complete`;
CREATE TABLE `vod_play_complete` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `deleted` bit(1) NOT NULL DEFAULT b'0',
  `create_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  `update_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  `video_id` varchar(255) NOT NULL,
  `user_id` bigint(20) NOT NULL,
  `create_at` bigint(20) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `video_id` (`video_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='视频播放完成记录';

-- ----------------------------
-- Table structure for vod_play_record
-- ----------------------------
DROP TABLE IF EXISTS `vod_play_record`;
CREATE TABLE `vod_play_record` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `deleted` bit(1) NOT NULL DEFAULT b'0',
  `create_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  `update_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  `video_id` varchar(255) NOT NULL,
  `user_id` bigint(20) NOT NULL,
  `current_time` double NOT NULL,
  `create_at` bigint(20) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_user_id_video_id` (`user_id`,`video_id`) USING BTREE,
  KEY `user_id` (`user_id`),
  KEY `video_id` (`video_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='视频播放记录';

-- ----------------------------
-- Table structure for vod_post_album
-- ----------------------------
DROP TABLE IF EXISTS `vod_post_album`;
CREATE TABLE `vod_post_album` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `deleted` bit(1) NOT NULL DEFAULT b'0',
  `create_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  `update_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  `album_id` bigint(20) NOT NULL,
  `album_name` varchar(255) NOT NULL,
  `channel_code` int(11) NOT NULL,
  `cover_url` varchar(255) NOT NULL,
  `post_type` int(11) NOT NULL,
  `total` int(11) NOT NULL,
  `scope` int(11) NOT NULL,
  `create_at` bigint(20) NOT NULL,
  `create_by` bigint(20) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `favlist_id` (`album_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='稿件合集';

-- ----------------------------
-- Table structure for vod_post_category
-- ----------------------------
DROP TABLE IF EXISTS `vod_post_category`;
CREATE TABLE `vod_post_category` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `deleted` bit(1) NOT NULL DEFAULT b'0',
  `create_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  `update_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
  `pid` int(11) NOT NULL COMMENT '分区级别【1 一级分区， 2 二级分区】',
  `name` varchar(255) NOT NULL COMMENT '分区名',
  `sort` int(11) NOT NULL DEFAULT '0' COMMENT '排序',
  `vip` bit(1) NOT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  KEY `name` (`name`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='视频分类';

-- ----------------------------
-- Table structure for vod_post_item
-- ----------------------------
DROP TABLE IF EXISTS `vod_post_item`;
CREATE TABLE `vod_post_item` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `album_id` bigint(20) NOT NULL,
  `post_id` varchar(255) NOT NULL,
  `pos` int(11) NOT NULL,
  `channel_code` int(11) NOT NULL,
  `object_id` varchar(255) NOT NULL,
  `format` varchar(255) NOT NULL,
  `url` varchar(255) NOT NULL,
  `width` int(11) NOT NULL,
  `height` int(11) NOT NULL,
  `horizontal` tinyint(1) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `favlist_id` (`album_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='稿件合集包含的稿件';

-- ----------------------------
-- Table structure for vod_post_tag
-- ----------------------------
DROP TABLE IF EXISTS `vod_post_tag`;
CREATE TABLE `vod_post_tag` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `tag_id` varchar(255) NOT NULL,
  `tag_name` varchar(255) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `tag_id` (`tag_id`),
  UNIQUE KEY `tag_name` (`tag_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='视频标签';

-- ----------------------------
-- Table structure for vod_search_record
-- ----------------------------
DROP TABLE IF EXISTS `vod_search_record`;
CREATE TABLE `vod_search_record` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `deleted` bit(1) NOT NULL DEFAULT b'0',
  `create_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  `update_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  `keyword` varchar(255) NOT NULL,
  `search_by` bigint(20) NOT NULL,
  `search_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `user_id` (`search_by`),
  KEY `keyword` (`keyword`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='搜索记录';

-- ----------------------------
-- Table structure for vod_site_notice
-- ----------------------------
DROP TABLE IF EXISTS `vod_site_notice`;
CREATE TABLE `vod_site_notice` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `deleted` bit(1) NOT NULL DEFAULT b'0',
  `create_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  `update_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  `content` text NOT NULL,
  `create_by` bigint(20) NOT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='站点公告';

-- ----------------------------
-- Table structure for vod_video_category_post
-- ----------------------------
DROP TABLE IF EXISTS `vod_video_category_post`;
CREATE TABLE `vod_video_category_post` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `deleted` bit(1) NOT NULL DEFAULT b'0',
  `create_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  `update_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  `video_id` varchar(255) CHARACTER SET utf8mb4 NOT NULL,
  `category_pid` int(11) NOT NULL,
  `category_id` int(11) NOT NULL,
  `duration` int(11) NOT NULL,
  `horizontal` bit(1) NOT NULL,
  `scope` int(11) NOT NULL COMMENT '视频可见范围',
  `publish_at` datetime NOT NULL,
  `publish_by` bigint(20) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UK_rfuvf3osnlaakifjdao0a8e2x` (`category_id`,`publish_by`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='视频分区稿件';

-- ----------------------------
-- Table structure for vod_video_error
-- ----------------------------
DROP TABLE IF EXISTS `vod_video_error`;
CREATE TABLE `vod_video_error` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `deleted` bit(1) NOT NULL,
  `create_time` datetime(6) NOT NULL,
  `update_time` datetime(6) NOT NULL,
  `video_id` varchar(255) NOT NULL,
  `error_code` int(11) NOT NULL,
  `error_info` varchar(255) NOT NULL,
  `solved` bit(1) NOT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  KEY `name` (`video_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='视频稿件错误';

-- ----------------------------
-- Table structure for vod_video_file
-- ----------------------------
DROP TABLE IF EXISTS `vod_video_file`;
CREATE TABLE `vod_video_file` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `deleted` bit(1) NOT NULL DEFAULT b'0',
  `create_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  `update_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  `video_id` varchar(255) NOT NULL,
  `object_id` varchar(255) NOT NULL,
  `channel_code` varchar(255) NOT NULL,
  `video_codec` varchar(255) NOT NULL,
  `vbit_rate` bigint(20) NOT NULL,
  `audio_codec` varchar(255) NOT NULL,
  `abit_rate` bigint(20) NOT NULL,
  `url_type` varchar(255) NOT NULL,
  `url` varchar(255) NOT NULL,
  `format_name` varchar(255) NOT NULL,
  `quality` varchar(255) NOT NULL,
  `width` int(11) NOT NULL,
  `height` int(11) NOT NULL,
  `horizontal` bit(1) NOT NULL,
  `duration` int(11) NOT NULL,
  `size` bigint(20) NOT NULL,
  `video_file_id` varchar(255) DEFAULT NULL COMMENT '待删除',
  PRIMARY KEY (`id`),
  UNIQUE KEY `object_id` (`object_id`) USING BTREE,
  UNIQUE KEY `video_file_id` (`video_file_id`) USING BTREE,
  KEY `video_id` (`video_id`),
  KEY `size` (`size`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='视频文件';

-- ----------------------------
-- Table structure for vod_video_post
-- ----------------------------
DROP TABLE IF EXISTS `vod_video_post`;
CREATE TABLE `vod_video_post` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `deleted` bit(1) NOT NULL DEFAULT b'0',
  `create_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  `update_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  `video_id` varchar(255) CHARACTER SET utf8mb4 NOT NULL,
  `title` varchar(255) CHARACTER SET utf8mb4 NOT NULL,
  `description` text CHARACTER SET utf8mb4,
  `category_pid` int(11) DEFAULT NULL,
  `category_id` int(11) DEFAULT NULL,
  `duration` int(11) NOT NULL,
  `horizontal` bit(1) NOT NULL,
  `cover_url` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL,
  `scope` int(11) NOT NULL COMMENT '视频可见范围',
  `status` int(11) NOT NULL COMMENT '视频贴状态',
  `publish_at` datetime DEFAULT NULL,
  `publish_by` bigint(20) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UK_rfuvf3osnlaakifjdao0a8e2x` (`video_id`) USING BTREE,
  KEY `user_id` (`publish_by`) USING BTREE,
  KEY `status` (`status`),
  KEY `scope` (`scope`),
  KEY `category_pid` (`category_pid`),
  KEY `category_id` (`category_id`),
  KEY `duration` (`duration`),
  KEY `pub_date` (`publish_at`),
  KEY `query_max` (`category_pid`,`category_id`,`scope`,`status`) USING BTREE,
  KEY `deleted` (`deleted`),
  FULLTEXT KEY `index_title` (`title`) /*!50100 WITH PARSER `ngram` */ 
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='视频稿件';

-- ----------------------------
-- Table structure for vod_video_statistic
-- ----------------------------
DROP TABLE IF EXISTS `vod_video_statistic`;
CREATE TABLE `vod_video_statistic` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `deleted` bit(1) NOT NULL DEFAULT b'0',
  `create_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  `update_time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  `video_id` varchar(255) NOT NULL,
  `view` int(11) NOT NULL,
  `danmaku` int(11) NOT NULL,
  `comment` int(11) NOT NULL,
  `favorite` int(11) NOT NULL,
  `share` int(11) NOT NULL,
  `thumb_up` int(11) NOT NULL,
  `thumb_down` int(11) NOT NULL,
  `coin` int(11) NOT NULL COMMENT 'bilibili 硬币',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UK_rfuvf3osnlaakifjdao0a8e2x` (`video_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='视频稿件数据';

-- ----------------------------
-- Table structure for vod_video_tag
-- ----------------------------
DROP TABLE IF EXISTS `vod_video_tag`;
CREATE TABLE `vod_video_tag` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `video_id` varchar(255) NOT NULL,
  `tag_id` varchar(255) NOT NULL,
  `scope` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `tag_id` (`tag_id`),
  KEY `video_id` (`video_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='视频稿件包含的标签';

SET FOREIGN_KEY_CHECKS = 1;
