/*
 Navicat Premium Data Transfer

 Source Server         : local_mariadb
 Source Server Type    : MariaDB
 Source Server Version : 100338 (10.3.38-MariaDB)
 Source Host           : localhost:33066
 Source Schema         : omc_db

 Target Server Type    : MariaDB
 Target Server Version : 100338 (10.3.38-MariaDB)
 File Encoding         : 65001

 Date: 15/07/2023 15:38:58
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for group
-- ----------------------------
DROP TABLE IF EXISTS `group`;
CREATE TABLE `group`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `menu_id` int(11) NULL DEFAULT NULL,
  `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `create_time` datetime NULL DEFAULT current_timestamp(),
  INDEX `fk_account_id`(`id`) USING BTREE,
  INDEX `fk_menu_id`(`name`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 12 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of group
-- ----------------------------
INSERT INTO `group` VALUES (1, 'admin', NULL, '', '2023-05-13 11:04:54');
INSERT INTO `group` VALUES (4, 'user', NULL, NULL, '2023-05-16 22:48:46');
INSERT INTO `group` VALUES (3, 'audit', NULL, NULL, '2023-05-16 22:48:54');
INSERT INTO `group` VALUES (2, 'operator', NULL, NULL, '2023-05-16 22:49:42');
INSERT INTO `group` VALUES (5, 'oss', NULL, NULL, '2023-05-16 22:54:50');

-- ----------------------------
-- Triggers structure for table group
-- ----------------------------
DROP TRIGGER IF EXISTS `tg_account_menu`;
delimiter ;;
CREATE TRIGGER `tg_account_menu` AFTER INSERT ON `group` FOR EACH ROW BEGIN
	call func_account_menu(16);
END
;;
delimiter ;

SET FOREIGN_KEY_CHECKS = 1;
