fix: sql系统部门初始数据

This commit is contained in:
TsMask
2024-05-13 11:38:42 +08:00
parent cf11242699
commit 475a4ad136
2 changed files with 5 additions and 110 deletions

View File

@@ -1,5 +1,6 @@
SET FOREIGN_KEY_CHECKS=0;
DROP TABLE IF EXISTS `sys_menu`;
CREATE TABLE IF NOT EXISTS `sys_dept` (
`dept_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '部门id',
`parent_id` bigint(20) DEFAULT 0 COMMENT '父部门id 默认0',
@@ -18,109 +19,7 @@ CREATE TABLE IF NOT EXISTS `sys_dept` (
PRIMARY KEY (`dept_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=100 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='部门表';
-- -- add default dept
INSERT
IGNORE INTO `omc_db`.`sys_dept` (
`dept_id`,
`parent_id`,
`ancestors`,
`dept_name`,
`order_num`,
`leader`,
`phone`,
`email`,
`status`,
`del_flag`,
`create_by`,
`create_time`,
`update_by`,
`update_time`
)
VALUES (
100,
0,
'0',
'系统维护部',
0,
'admin',
'',
'',
'1',
'0',
'admin',
1697091866188,
'',
NULL
);
INSERT
IGNORE INTO `omc_db`.`sys_dept` (
`dept_id`,
`parent_id`,
`ancestors`,
`dept_name`,
`order_num`,
`leader`,
`phone`,
`email`,
`status`,
`del_flag`,
`create_by`,
`create_time`,
`update_by`,
`update_time`
)
VALUES (
101,
100,
'0,100',
'运维一部',
1,
'admin',
'',
'',
'1',
'0',
'admin',
1697091866192,
'',
NULL
);
-- for cn/en locale
UPDATE `omc_db`.`sys_dept`
SET
`parent_id` = 0,
`ancestors` = '0',
`dept_name` = 'dept.root',
`order_num` = 0,
`leader` = 'supervisor',
`phone` = NULL,
`email` = NULL,
`status` = '1',
`del_flag` = '0',
`create_by` = 'supervisor',
`create_time` = 1699348237468,
`update_by` = NULL,
`update_time` = 0
WHERE `dept_id` = 100;
UPDATE `omc_db`.`sys_dept`
SET
`parent_id` = 100,
`ancestors` = '0,100',
`dept_name` = 'dept.root.item1',
`order_num` = 1,
`leader` = 'supervisor',
`phone` = NULL,
`email` = NULL,
`status` = '1',
`del_flag` = '0',
`create_by` = 'supervisor',
`create_time` = 1699348237468,
`update_by` = NULL,
`update_time` = 0
WHERE `dept_id` = 101;
INSERT IGNORE INTO `sys_dept` VALUES (1, 0, '0', 'dept.root', 0, 'supervisor', NULL, NULL, '1', '0', 'supervisor', 1699348237468, NULL, 0);
INSERT IGNORE INTO `sys_dept` VALUES (2, 1, '0,1', 'dept.root.item1', 1, 'supervisor', NULL, NULL, '1', '0', 'supervisor', 1699348237468, 'supervisor', 1715570736053);
SET FOREIGN_KEY_CHECKS=1;