添加sql

This commit is contained in:
zayac 2024-04-01 20:31:23 +08:00
parent d8ed1bfdd0
commit 9e78c6cbea

60
ky_tools.sql Normal file
View File

@ -0,0 +1,60 @@
/*
Navicat Premium Data Transfer
Source Server : ky
Source Server Type : MySQL
Source Server Version : 80200 (8.2.0)
Source Host : 45.89.233.228:3306
Source Schema : ky_tools
Target Server Type : MySQL
Target Server Version : 80200 (8.2.0)
File Encoding : 65001
Date: 01/04/2024 20:29:31
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for ky_account
-- ----------------------------
DROP TABLE IF EXISTS `ky_account`;
CREATE TABLE `ky_account` (
`id` int NOT NULL AUTO_INCREMENT,
`username` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '账号',
`password` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '密码',
`type` enum('ky','hth','jy') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '类型 ky hth',
`name` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '别名',
`url` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'url',
`x_api_token` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'x-api-token',
`headers` json NULL COMMENT 'headers',
`user_id` int NOT NULL COMMENT '关联的用户id',
`status` int NOT NULL DEFAULT 0 COMMENT '账号的状态默认为0 禁用',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `username`(`username` ASC) USING BTREE,
INDEX `user_id`(`user_id` ASC) USING BTREE,
CONSTRAINT `ky_account_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `ky_user` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for ky_user
-- ----------------------------
DROP TABLE IF EXISTS `ky_user`;
CREATE TABLE `ky_user` (
`id` int NOT NULL AUTO_INCREMENT COMMENT '唯一键',
`username` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '账号',
`password` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '密码',
`name` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '别名',
`email` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '邮箱',
`bot_token` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '机器人token',
`group_id` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '群组id',
`chat_id` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '私聊id',
`telegram_ids` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'telegram_id ,分割',
`status` tinyint NOT NULL DEFAULT 0 COMMENT '用户状态 0 禁用 1启用',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `username`(`username` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1;