admin.sql
2.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*
Navicat Premium Data Transfer
Source Server : bishe
Source Server Type : MySQL
Source Server Version : 50720
Source Host : localhost:3306
Source Schema : girls
Target Server Type : MySQL
Target Server Version : 50720
File Encoding : 65001
Date: 12/02/2022 13:05:53
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for admin
-- ----------------------------
DROP TABLE IF EXISTS `admin`;
CREATE TABLE `admin` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`password` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 18 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of admin
-- ----------------------------
INSERT INTO `admin` VALUES (4, '张三', '4321');
INSERT INTO `admin` VALUES (5, '李四', '21321');
INSERT INTO `admin` VALUES (6, '曹操', '123124');
INSERT INTO `admin` VALUES (7, '刘备', '12132');
INSERT INTO `admin` VALUES (8, '曹猛地', '123124');
-- ----------------------------
-- Triggers structure for table admin
-- ----------------------------
DROP TRIGGER IF EXISTS `admin_insert_trigger`;
delimiter ;;
CREATE TRIGGER `admin_insert_trigger` AFTER INSERT ON `admin` FOR EACH ROW begin
insert into user_logs(id, operation, operate_time, operate_id, operate_params) VALUES
(null,'insert',now(),new.id,concat('插入的内容为:','id:',new.id,'username:',new.username,'password:',new.password));
end
;;
delimiter ;
-- ----------------------------
-- Triggers structure for table admin
-- ----------------------------
DROP TRIGGER IF EXISTS `admin_update_trigger`;
delimiter ;;
CREATE TRIGGER `admin_update_trigger` AFTER UPDATE ON `admin` FOR EACH ROW begin
insert into user_logs(id, operation, operate_time, operate_id, operate_params) VALUES
(null,'update',now(),new.id,
concat('更新前的内容为','id:',old.id,'username:',old.username,'password:',old.password,
'| 更新后的内容为','id:',new.id,' username:',new.username,' password:',new.password));
end
;;
delimiter ;
-- ----------------------------
-- Triggers structure for table admin
-- ----------------------------
DROP TRIGGER IF EXISTS `admin_delete_trigger`;
delimiter ;;
CREATE TRIGGER `admin_delete_trigger` AFTER DELETE ON `admin` FOR EACH ROW begin
insert into user_logs(id, operation, operate_time, operate_id, operate_params) VALUES
(null,'delete',now(),old.id,
concat('删除前前的内容为','id:',old.id,'username:',old.username,'password:',old.password));
end
;;
delimiter ;
SET FOREIGN_KEY_CHECKS = 1;