SET FOREIGN_KEY_CHECKS=0;

CREATE TABLE
    IF NOT EXISTS `sys_role_dept` (
        `role_id` bigint(20) NOT NULL COMMENT '角色ID',
        `dept_id` bigint(20) NOT NULL COMMENT '部门ID',
        PRIMARY KEY (`role_id`, `dept_id`) USING BTREE
    ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色和部门关联表' ROW_FORMAT = Dynamic;

SET FOREIGN_KEY_CHECKS=1;    