parent
b9d71363fe
commit
e4670a4379
@ -1,68 +1,123 @@
|
||||
create table rcode
|
||||
(
|
||||
skey varchar(255) not null,
|
||||
code varchar(5) null,
|
||||
constraint rcode_code_uindex
|
||||
unique (code),
|
||||
constraint rcode_skey_uindex
|
||||
unique (skey)
|
||||
);
|
||||
/*
|
||||
Navicat Premium Data Transfer
|
||||
|
||||
alter table rcode
|
||||
add primary key (skey);
|
||||
Source Server : 1
|
||||
Source Server Type : MySQL
|
||||
Source Server Version : 50719
|
||||
Source Host : localhost:3306
|
||||
Source Schema : wxlogin
|
||||
|
||||
create table task
|
||||
(
|
||||
id int auto_increment
|
||||
primary key,
|
||||
name varchar(200) not null,
|
||||
property varchar(255) default '0' not null comment '内容',
|
||||
stuid varchar(255) null,
|
||||
deadtime varchar(255) default '0' not null,
|
||||
status int default 0 null,
|
||||
create_time datetime null comment '创建时间戳',
|
||||
last_time datetime null comment '最后修改时间戳',
|
||||
constraint name
|
||||
unique (name)
|
||||
)
|
||||
charset = utf8;
|
||||
Target Server Type : MySQL
|
||||
Target Server Version : 50719
|
||||
File Encoding : 65001
|
||||
|
||||
create table user
|
||||
(
|
||||
open_id varchar(100) collate utf8mb4_unicode_ci not null comment 'open_id'
|
||||
primary key,
|
||||
skey varchar(100) collate utf8mb4_unicode_ci not null comment 'skey',
|
||||
create_time timestamp default CURRENT_TIMESTAMP null comment '创建时间',
|
||||
last_visit_time timestamp default CURRENT_TIMESTAMP null comment '最后登录时间',
|
||||
session_key varchar(100) collate utf8mb4_unicode_ci not null comment 'session_key',
|
||||
city varchar(255) null comment '市',
|
||||
province varchar(255) null comment '省',
|
||||
country varchar(255) null comment '国',
|
||||
avatar_url varchar(255) null comment '头像',
|
||||
gender tinyint(11) null comment '性别',
|
||||
nick_name varchar(255) null comment '网名',
|
||||
student_number varchar(255) null comment '学号',
|
||||
name varchar(255) null comment '姓名',
|
||||
power int(1) default 0 null comment '管理员权限'
|
||||
)
|
||||
comment '微信用户信息' charset = utf8;
|
||||
Date: 15/11/2022 19:25:02
|
||||
*/
|
||||
|
||||
create table taskson
|
||||
(
|
||||
id int auto_increment
|
||||
primary key,
|
||||
task_id int not null,
|
||||
studentnumber varchar(255) null,
|
||||
finishtime timestamp default CURRENT_TIMESTAMP null,
|
||||
filepath varchar(256) charset latin1 null,
|
||||
constraint `f_key sutdentnumber`
|
||||
foreign key (studentnumber) references user (student_number),
|
||||
constraint f_keytaski_id
|
||||
foreign key (task_id) references task (id)
|
||||
)
|
||||
charset = utf8;
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
create index Student_Number
|
||||
on user (student_number);
|
||||
-- ----------------------------
|
||||
-- Table structure for dragon
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `dragon`;
|
||||
CREATE TABLE `dragon` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
|
||||
`property` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '内容',
|
||||
`stuid` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
|
||||
`deadtime` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0',
|
||||
`status` int(11) NULL DEFAULT 0,
|
||||
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间戳',
|
||||
`last_time` datetime NULL DEFAULT NULL COMMENT '最后修改时间戳',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE INDEX `name`(`name`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for dragonson
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `dragonson`;
|
||||
CREATE TABLE `dragonson` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`dragon_id` int(11) NOT NULL,
|
||||
`studentnumber` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
|
||||
`finishtime` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`text` varchar(256) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
INDEX `f_key sutdentnumber`(`studentnumber`) USING BTREE,
|
||||
INDEX `f_keytaski_id`(`dragon_id`) USING BTREE,
|
||||
CONSTRAINT `dragonson_ibfk_1` FOREIGN KEY (`studentnumber`) REFERENCES `user` (`student_number`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
CONSTRAINT `dragonson_ibfk_2` FOREIGN KEY (`dragon_id`) REFERENCES `dragon` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for rcode
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `rcode`;
|
||||
CREATE TABLE `rcode` (
|
||||
`skey` varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
|
||||
`code` varchar(5) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`skey`) USING BTREE,
|
||||
UNIQUE INDEX `rcode_code_uindex`(`code`) USING BTREE,
|
||||
UNIQUE INDEX `rcode_skey_uindex`(`skey`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for task
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `task`;
|
||||
CREATE TABLE `task` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
|
||||
`property` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '内容',
|
||||
`stuid` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
|
||||
`deadtime` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0',
|
||||
`status` int(11) NULL DEFAULT 0,
|
||||
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间戳',
|
||||
`last_time` datetime NULL DEFAULT NULL COMMENT '最后修改时间戳',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE INDEX `name`(`name`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for taskson
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `taskson`;
|
||||
CREATE TABLE `taskson` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`dragon_id` int(11) NOT NULL,
|
||||
`studentnumber` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
|
||||
`finishtime` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`filepath` varchar(256) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
INDEX `f_key sutdentnumber`(`studentnumber`) USING BTREE,
|
||||
INDEX `f_keytaski_id`(`dragon_id`) USING BTREE,
|
||||
CONSTRAINT `f_key sutdentnumber` FOREIGN KEY (`studentnumber`) REFERENCES `user` (`student_number`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
CONSTRAINT `f_keytaski_id` FOREIGN KEY (`dragon_id`) REFERENCES `task` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for user
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `user`;
|
||||
CREATE TABLE `user` (
|
||||
`open_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'open_id',
|
||||
`skey` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'skey',
|
||||
`create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`last_visit_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '最后登录时间',
|
||||
`session_key` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'session_key',
|
||||
`city` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '市',
|
||||
`province` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '省',
|
||||
`country` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '国',
|
||||
`avatar_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '头像',
|
||||
`gender` tinyint(11) NULL DEFAULT NULL COMMENT '性别',
|
||||
`nick_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '网名',
|
||||
`student_number` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '学号',
|
||||
`name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '姓名',
|
||||
`power` int(1) NULL DEFAULT 0 COMMENT '管理员权限',
|
||||
PRIMARY KEY (`open_id`) USING BTREE,
|
||||
INDEX `Student_Number`(`student_number`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '微信用户信息' ROW_FORMAT = DYNAMIC;
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
|
Loading…
Reference in new issue