-- ---------------------------- -- 角色和部门关联表 角色1-N部门 -- ---------------------------- drop table if exists sys_role_dept; create table sys_role_dept ( role_id bigint not null, -- PostgreSQL 无需指定列长度 dept_id bigint not null, primary key (role_id, dept_id) ); -- ---------------------------- -- 初始化-角色和部门关联表数据 -- ---------------------------- insert into sys_role_dept (role_id, dept_id) values ('2', '100'), ('2', '101'), ('2', '105');