multi-tenant branch changed db to tenants_db

This commit is contained in:
2024-06-19 11:23:36 +08:00
parent 7a785182b7
commit 2f08c044fc
22 changed files with 374 additions and 374 deletions

View File

@@ -1,7 +1,7 @@
SET FOREIGN_KEY_CHECKS=0;
DROP TABLE IF EXISTS `omc_db`.`sys_dept`;
CREATE TABLE `omc_db`.`sys_dept` (
DROP TABLE IF EXISTS `sys_dept`;
CREATE TABLE `sys_dept` (
`dept_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '部门id',
`parent_id` bigint(20) NULL DEFAULT 0 COMMENT '父部门id 默认0',
`ancestors` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '祖级列表',
@@ -22,7 +22,7 @@ CREATE TABLE `omc_db`.`sys_dept` (
-- -- add default dept
INSERT
IGNORE INTO `omc_db`.`sys_dept` (
IGNORE INTO `sys_dept` (
`dept_id`,
`parent_id`,
`ancestors`,
@@ -56,7 +56,7 @@ VALUES (
);
INSERT
IGNORE INTO `omc_db`.`sys_dept` (
IGNORE INTO `sys_dept` (
`dept_id`,
`parent_id`,
`ancestors`,
@@ -90,7 +90,7 @@ VALUES (
);
-- for cn/en locale
UPDATE `omc_db`.`sys_dept`
UPDATE `sys_dept`
SET
`parent_id` = 0,
`ancestors` = '0',
@@ -107,7 +107,7 @@ SET
`update_time` = 0
WHERE `dept_id` = 100;
UPDATE `omc_db`.`sys_dept`
UPDATE `sys_dept`
SET
`parent_id` = 100,
`ancestors` = '0,100',