member_tag.sql 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. create table member_tag
  2. (
  3. id bigint auto_increment comment '编号'
  4. primary key,
  5. name varchar(30) default '' not null comment '标签名称',
  6. creator varchar(64) default '' null comment '创建者',
  7. create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
  8. updater varchar(64) default '' null comment '更新者',
  9. update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '更新时间',
  10. deleted bit default b'0' not null comment '是否删除',
  11. tenant_id bigint default 0 not null comment '租户编号'
  12. )
  13. comment '会员标签';
  14. alter table member_user add column tag_ids varchar(255) null comment '用户标签编号列表,以逗号分隔';
  15. -- 菜单 SQL
  16. INSERT INTO system_menu(
  17. name, permission, type, sort, parent_id,
  18. path, icon, component, status, component_name
  19. )
  20. VALUES (
  21. '会员标签管理', '', 2, 3, 2262,
  22. 'tag', '', 'member/tag/index', 0, 'MemberTag'
  23. );
  24. -- 按钮父菜单ID
  25. -- 暂时只支持 MySQL。如果你是 Oracle、PostgreSQL、SQLServer 的话,需要手动修改 @parentId 的部分的代码
  26. SELECT @parentId := LAST_INSERT_ID();
  27. -- 按钮 SQL
  28. INSERT INTO system_menu(
  29. name, permission, type, sort, parent_id,
  30. path, icon, component, status
  31. )
  32. VALUES (
  33. '会员标签查询', 'member:tag:query', 3, 1, @parentId,
  34. '', '', '', 0
  35. );
  36. INSERT INTO system_menu(
  37. name, permission, type, sort, parent_id,
  38. path, icon, component, status
  39. )
  40. VALUES (
  41. '会员标签创建', 'member:tag:create', 3, 2, @parentId,
  42. '', '', '', 0
  43. );
  44. INSERT INTO system_menu(
  45. name, permission, type, sort, parent_id,
  46. path, icon, component, status
  47. )
  48. VALUES (
  49. '会员标签更新', 'member:tag:update', 3, 3, @parentId,
  50. '', '', '', 0
  51. );
  52. INSERT INTO system_menu(
  53. name, permission, type, sort, parent_id,
  54. path, icon, component, status
  55. )
  56. VALUES (
  57. '会员标签删除', 'member:tag:delete', 3, 4, @parentId,
  58. '', '', '', 0
  59. );
  60. INSERT INTO system_menu(
  61. name, permission, type, sort, parent_id,
  62. path, icon, component, status
  63. )
  64. VALUES (
  65. '会员标签导出', 'member:tag:export', 3, 5, @parentId,
  66. '', '', '', 0
  67. );