admin.sql 2.7 KB
/*
 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;