1. 补全后端的其余模块
2. 新增用户管理多部门的逻辑
This commit is contained in:
42
sql/dm/新增用户与组织关系表并迁移.sql
Normal file
42
sql/dm/新增用户与组织关系表并迁移.sql
Normal file
@@ -0,0 +1,42 @@
|
||||
create table "RUOYI-VUE-PRO".SYSTEM_USER_DEPT (
|
||||
ID BIGINT primary key, -- 自增主键
|
||||
USER_ID BIGINT not null,
|
||||
DEPT_ID BIGINT not null,
|
||||
TENANT_ID BIGINT default 0 not null,
|
||||
REMARK VARCHAR(2000),
|
||||
CREATOR VARCHAR(256) default '',
|
||||
CREATE_TIME TIMESTAMP default CURRENT_TIMESTAMP not null,
|
||||
UPDATER VARCHAR(256) default '',
|
||||
DELETED TINYINT default 0 not null,
|
||||
UPDATE_TIME TIMESTAMP default CURRENT_TIMESTAMP not null
|
||||
);
|
||||
|
||||
comment on table "RUOYI-VUE-PRO".SYSTEM_USER_DEPT is '用户与部门关系表';
|
||||
comment on column "RUOYI-VUE-PRO".SYSTEM_USER_DEPT.ID is '主键ID';
|
||||
comment on column "RUOYI-VUE-PRO".SYSTEM_USER_DEPT.USER_ID is '用户ID';
|
||||
comment on column "RUOYI-VUE-PRO".SYSTEM_USER_DEPT.DEPT_ID is '部门ID';
|
||||
comment on column "RUOYI-VUE-PRO".SYSTEM_USER_DEPT.TENANT_ID is '租户编号';
|
||||
comment on column "RUOYI-VUE-PRO".SYSTEM_USER_DEPT.REMARK is '备注';
|
||||
comment on column "RUOYI-VUE-PRO".SYSTEM_USER_DEPT.CREATOR is '创建者';
|
||||
comment on column "RUOYI-VUE-PRO".SYSTEM_USER_DEPT.CREATE_TIME is '创建时间';
|
||||
comment on column "RUOYI-VUE-PRO".SYSTEM_USER_DEPT.UPDATER is '更新者';
|
||||
comment on column "RUOYI-VUE-PRO".SYSTEM_USER_DEPT.UPDATE_TIME is '更新时间';
|
||||
|
||||
-- 1. 将原有用户表中的 DEPT_ID 字段数据迁移到关系表(ID 自增,无需指定)
|
||||
insert into "RUOYI-VUE-PRO".SYSTEM_USER_DEPT (
|
||||
USER_ID, DEPT_ID, TENANT_ID, REMARK, CREATOR, CREATE_TIME, UPDATER, UPDATE_TIME
|
||||
)
|
||||
select
|
||||
ID as USER_ID,
|
||||
DEPT_ID,
|
||||
TENANT_ID,
|
||||
null as REMARK,
|
||||
CREATOR,
|
||||
CREATE_TIME,
|
||||
UPDATER,
|
||||
UPDATE_TIME
|
||||
from "RUOYI-VUE-PRO".SYSTEM_USERS
|
||||
where DEPT_ID is not null;
|
||||
|
||||
-- 移除用户表中的 DEPT_ID 字段
|
||||
alter table "RUOYI-VUE-PRO".SYSTEM_USERS drop column DEPT_ID;
|
||||
8
sql/dm/新增组织机构类型字段.sql
Normal file
8
sql/dm/新增组织机构类型字段.sql
Normal file
@@ -0,0 +1,8 @@
|
||||
alter table "RUOYI-VUE-PRO".SYSTEM_DEPT
|
||||
add IS_COMPANY BIT default 0 not null;
|
||||
comment
|
||||
on column "RUOYI-VUE-PRO".SYSTEM_DEPT.IS_COMPANY is '是否公司';
|
||||
alter table "RUOYI-VUE-PRO".SYSTEM_DEPT
|
||||
add IS_GROUP BIT default 0 not null;
|
||||
comment
|
||||
on column "RUOYI-VUE-PRO".SYSTEM_DEPT.IS_GROUP is '是否集团';
|
||||
Reference in New Issue
Block a user