|
| 1 | +drop table if exists `t_permission_role`; |
| 2 | + |
| 3 | +create table `t_permission_role` |
| 4 | +( |
| 5 | + `id` int not null auto_increment comment '主键id', |
| 6 | + `name` varchar(255) not null comment '名称', |
| 7 | + `description` varchar(2000) comment '描述', |
| 8 | + `created_by` varchar(60) not null comment '创建人', |
| 9 | + `created_time` timestamp not null default current_timestamp comment '创建时间', |
| 10 | + `last_updated_by` varchar(60) not null comment '最后修改人', |
| 11 | + `last_updated_time` timestamp not null default current_timestamp comment '更新时间', |
| 12 | + primary key (`id`) using btree, |
| 13 | + unique index `u_idx_permission_role` (`name`) using btree |
| 14 | +) engine = innodb comment = ''; |
| 15 | + |
| 16 | +drop table if exists `t_auth_usesr_units_roles`; |
| 17 | + |
| 18 | +create table `t_auth_users_units_roles` |
| 19 | +( |
| 20 | + `id` int not null auto_increment comment '主键id', |
| 21 | + `user_id` int not null comment '用户', |
| 22 | + `unit_id` int not null comment '业务单元', |
| 23 | + `unit_type` int not null comment '业务单元类型', |
| 24 | + `tenant_id` int not null comment '组织id', |
| 25 | + `role_id` int not null comment '角色id', |
| 26 | + `expired_time` timestamp comment '过期时间', |
| 27 | + `created_by` varchar(60) not null comment '创建人', |
| 28 | + `created_time` timestamp not null default current_timestamp comment '创建时间', |
| 29 | + `last_updated_by` varchar(60) not null comment '最后修改人', |
| 30 | + `last_updated_time` timestamp not null default current_timestamp comment '更新时间', |
| 31 | + primary key (`id`) using btree, |
| 32 | + unique index `u_idx_auth_users_units_roles` (`user_id`, `unit_id`, `unit_type`) using btree |
| 33 | +) engine = innodb comment = ''; |
0 commit comments