/*
 Navicat Premium Data Transfer

 Source Server         : mysql
 Source Server Type    : MySQL
 Source Server Version : 50731
 Source Host           : localhost:3306
 Source Schema         : scbc_cts

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

 Date: 10/12/2020 10:17:46
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for branch
-- ----------------------------
DROP TABLE IF EXISTS `branch`;
CREATE TABLE `branch`  (
  `name` varchar(255) CHARACTER SET gb18030 COLLATE gb18030_chinese_ci NOT NULL COMMENT '分支名称',
  `quarter` varchar(255) CHARACTER SET gb18030 COLLATE gb18030_chinese_ci NULL DEFAULT NULL COMMENT '分支所属季度',
  `address` varchar(255) CHARACTER SET gb18030 COLLATE gb18030_chinese_ci NULL DEFAULT NULL COMMENT '分支地址(gerrit)',
  `provider` varchar(255) CHARACTER SET gb18030 COLLATE gb18030_chinese_ci NULL DEFAULT NULL COMMENT '分支供应商',
  `chip` varchar(255) CHARACTER SET gb18030 COLLATE gb18030_chinese_ci NULL DEFAULT NULL COMMENT '分支机芯方案',
  `type` varchar(255) CHARACTER SET gb18030 COLLATE gb18030_chinese_ci NULL DEFAULT NULL COMMENT '分支类型：主干、CTS、量产、ODF',
  `status` varchar(255) CHARACTER SET gb18030 COLLATE gb18030_chinese_ci NULL DEFAULT NULL COMMENT '分支状态：在用、停用',
  `note` varchar(255) CHARACTER SET gb18030 COLLATE gb18030_chinese_ci NULL DEFAULT NULL COMMENT '分支备注',
  PRIMARY KEY (`name`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = gb18030 COLLATE = gb18030_chinese_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for brand
-- ----------------------------
DROP TABLE IF EXISTS `brand`;
CREATE TABLE `brand`  (
  `name` varchar(255) CHARACTER SET gb18030 COLLATE gb18030_chinese_ci NOT NULL COMMENT '品牌名称',
  `logo` mediumblob NULL COMMENT '最新logo',
  `note` varchar(255) CHARACTER SET gb18030 COLLATE gb18030_chinese_ci NULL DEFAULT '' COMMENT '品牌备注',
  `fav_cfg` varchar(1024) CHARACTER SET gb18030 COLLATE gb18030_chinese_ci NULL DEFAULT NULL COMMENT '最新首行配置',
  `local_cfg` varchar(1024) CHARACTER SET gb18030 COLLATE gb18030_chinese_ci NULL DEFAULT NULL COMMENT '最新SChannel配置',
  `apps_cfg` varchar(1024) CHARACTER SET gb18030 COLLATE gb18030_chinese_ci NULL DEFAULT NULL COMMENT '最新APPS配置',
  PRIMARY KEY (`name`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = gb18030 COLLATE = gb18030_chinese_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for log
-- ----------------------------
DROP TABLE IF EXISTS `log`;
CREATE TABLE `log`  (
  `id` int(11) NOT NULL COMMENT '自增id',
  `datetime` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '发生时间',
  `user` varchar(255) CHARACTER SET gb18030 COLLATE gb18030_chinese_ci NULL DEFAULT NULL COMMENT '触发的用户',
  `content` varchar(255) CHARACTER SET gb18030 COLLATE gb18030_chinese_ci NULL DEFAULT NULL COMMENT '内容',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = gb18030 COLLATE = gb18030_chinese_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for qbrand
-- ----------------------------
DROP TABLE IF EXISTS `qbrand`;
CREATE TABLE `qbrand`  (
  `soc` varchar(255) CHARACTER SET gb18030 COLLATE gb18030_chinese_ci NULL DEFAULT NULL COMMENT '品牌机芯',
  `quarter` varchar(255) CHARACTER SET gb18030 COLLATE gb18030_chinese_ci NULL DEFAULT NULL COMMENT '季度：%02d-Q1',
  `brand` varchar(255) CHARACTER SET gb18030 COLLATE gb18030_chinese_ci NULL DEFAULT NULL COMMENT '品牌名称',
  `whitelist` varchar(255) CHARACTER SET gb18030 COLLATE gb18030_chinese_ci NULL DEFAULT NULL COMMENT '白名单状态',
  `version` varchar(255) CHARACTER SET gb18030 COLLATE gb18030_chinese_ci NULL DEFAULT NULL COMMENT '软件版本',
  `oemkey` varchar(255) CHARACTER SET gb18030 COLLATE gb18030_chinese_ci NULL DEFAULT NULL COMMENT 'oem',
  `approved` varchar(255) CHARACTER SET gb18030 COLLATE gb18030_chinese_ci NULL DEFAULT NULL COMMENT '通过状态',
  `approveddate` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '认证通过日期',
  `logo` blob NULL COMMENT 'logo图片',
  `pic1` blob NULL COMMENT '首行应用图片',
  `pic2` blob NULL COMMENT 'APPS应用截图',
  `fingerprint` varchar(255) CHARACTER SET gb18030 COLLATE gb18030_chinese_ci NULL DEFAULT NULL COMMENT 'fingerprint字符串',
  `builddate` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '编译时间',
  `gtvs` varchar(255) CHARACTER SET gb18030 COLLATE gb18030_chinese_ci NULL DEFAULT NULL COMMENT 'gtvs版本',
  `note` varchar(255) CHARACTER SET gb18030 COLLATE gb18030_chinese_ci NULL DEFAULT NULL COMMENT '备注',
  `apps_cfg` text CHARACTER SET gb18030 COLLATE gb18030_chinese_ci NULL COMMENT 'model中的apps配置',
  `fav_cfg` text CHARACTER SET gb18030 COLLATE gb18030_chinese_ci NULL COMMENT 'model中的首行应用配置',
  `local_cfg` text CHARACTER SET gb18030 COLLATE gb18030_chinese_ci NULL COMMENT 'model中的SChannel配置',
  `ftpdir` varchar(255) CHARACTER SET gb18030 COLLATE gb18030_chinese_ci NULL DEFAULT NULL COMMENT 'ftp下载路径',
  `codedir` varchar(255) CHARACTER SET gb18030 COLLATE gb18030_chinese_ci NULL DEFAULT NULL COMMENT '代码路径：只对Admin有效',
  `status` bit(1) NULL DEFAULT NULL COMMENT '相对上一季度是否有配置变化：主要用于软件提醒该品牌有修改，在编译时需要注意变更处理'
) ENGINE = InnoDB CHARACTER SET = gb18030 COLLATE = gb18030_chinese_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for quarter
-- ----------------------------
DROP TABLE IF EXISTS `quarter`;
CREATE TABLE `quarter`  (
  `name` varchar(255) CHARACTER SET gb18030 COLLATE gb18030_chinese_ci NOT NULL COMMENT '季度名称',
  `scp` varchar(255) CHARACTER SET gb18030 COLLATE gb18030_chinese_ci NULL DEFAULT NULL COMMENT 'SecurityPatch',
  `note` varchar(255) CHARACTER SET gb18030 COLLATE gb18030_chinese_ci NULL DEFAULT NULL COMMENT '季度备注',
  PRIMARY KEY (`name`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = gb18030 COLLATE = gb18030_chinese_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for server
-- ----------------------------
DROP TABLE IF EXISTS `server`;
CREATE TABLE `server`  (
  `name` varchar(255) CHARACTER SET gb18030 COLLATE gb18030_chinese_ci NOT NULL COMMENT '服务器名称',
  `ip` varchar(255) CHARACTER SET gb18030 COLLATE gb18030_chinese_ci NULL DEFAULT NULL COMMENT '服务器IP地址',
  `type` varchar(255) CHARACTER SET gb18030 COLLATE gb18030_chinese_ci NULL DEFAULT NULL COMMENT '服务器类型：ssh，ftp，sftp',
  `user` varchar(255) CHARACTER SET gb18030 COLLATE gb18030_chinese_ci NULL DEFAULT NULL COMMENT '服务器账号',
  `password` varchar(255) CHARACTER SET gb18030 COLLATE gb18030_chinese_ci NULL DEFAULT NULL COMMENT '服务器密码：使用RSA加密',
  `note` varchar(255) CHARACTER SET gb18030 COLLATE gb18030_chinese_ci NULL DEFAULT NULL COMMENT '服务器备注',
  PRIMARY KEY (`name`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = gb18030 COLLATE = gb18030_chinese_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for soc
-- ----------------------------
DROP TABLE IF EXISTS `soc`;
CREATE TABLE `soc`  (
  `name` varchar(255) CHARACTER SET gb18030 COLLATE gb18030_chinese_ci NOT NULL COMMENT '机芯名称',
  `provider` varchar(255) CHARACTER SET gb18030 COLLATE gb18030_chinese_ci NULL DEFAULT NULL COMMENT '供应商',
  `note` varchar(255) CHARACTER SET gb18030 COLLATE gb18030_chinese_ci NULL DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`name`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = gb18030 COLLATE = gb18030_chinese_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user`  (
  `user` varchar(255) CHARACTER SET gb18030 COLLATE gb18030_chinese_ci NOT NULL COMMENT '软件账号',
  `password` varchar(255) CHARACTER SET gb18030 COLLATE gb18030_chinese_ci NULL DEFAULT NULL COMMENT '软件账号密码：使用RSA加密',
  `permission` varchar(255) CHARACTER SET gb18030 COLLATE gb18030_chinese_ci NULL DEFAULT NULL COMMENT '软件权限：\"0\"或\"1\"表示权限禁用或启用，字符位序表示某个权限',
  PRIMARY KEY (`user`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = gb18030 COLLATE = gb18030_chinese_ci ROW_FORMAT = Dynamic;

SET FOREIGN_KEY_CHECKS = 1;
