member_group.sql 2.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. create table member_group
  2. (
  3. id bigint auto_increment comment '编号' primary key,
  4. name varchar(30) default '' not null comment '名称',
  5. remark varchar(255) default '' not null comment '备注',
  6. status tinyint default 0 not null comment '状态',
  7. creator varchar(64) default '' null comment '创建者',
  8. create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
  9. updater varchar(64) default '' null comment '更新者',
  10. update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '更新时间',
  11. deleted bit default b'0' not null comment '是否删除',
  12. tenant_id bigint default 0 not null comment '租户编号'
  13. )
  14. comment '用户分组';
  15. alter table member_user add column group_id bigint null comment '用户分组编号';
  16. -- 菜单 SQL
  17. INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status, component_name)
  18. VALUES ('用户分组', '', 2, 5, 2262, 'group', '', 'member/group/index', 0, 'MemberGroup');
  19. -- 按钮父菜单ID
  20. -- 暂时只支持 MySQL。如果你是 Oracle、PostgreSQL、SQLServer 的话,需要手动修改 @parentId 的部分的代码
  21. SELECT @parentId := LAST_INSERT_ID();
  22. -- 按钮 SQL
  23. INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
  24. VALUES ('用户分组查询', 'member:group:query', 3, 1, @parentId, '', '', '', 0);
  25. INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
  26. VALUES ('用户分组创建', 'member:group:create', 3, 2, @parentId, '', '', '', 0);
  27. INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
  28. VALUES ('用户分组更新', 'member:group:update', 3, 3, @parentId, '', '', '', 0);
  29. INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
  30. VALUES ('用户分组删除', 'member:group:delete', 3, 4, @parentId, '', '', '', 0);
  31. INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status)
  32. VALUES ('用户分组导出', 'member:group:export', 3, 5, @parentId, '', '', '', 0);