update_5.0-5.1.sql 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. ALTER TABLE gen_table ADD (data_name VARCHAR2(200) DEFAULT '');
  2. COMMENT ON COLUMN gen_table.data_name IS '数据源名称';
  3. UPDATE sys_menu SET path = 'powerjob', component = 'monitor/powerjob/index', perms = 'monitor:powerjob:list', remark = 'powerjob控制台菜单' WHERE menu_id = 120;
  4. -- ----------------------------
  5. -- 第三方平台授权表
  6. -- ----------------------------
  7. create table sys_social
  8. (
  9. id number(20) not null,
  10. user_id number(20) not null,
  11. tenant_id varchar2(20) default null,
  12. auth_id varchar2(255) not null,
  13. source varchar2(255) not null,
  14. open_id varchar2(255) default null,
  15. user_name varchar2(30) not null,
  16. nick_name varchar2(30) default '',
  17. email varchar2(255) default '',
  18. avatar varchar2(500) default '',
  19. access_token varchar2(255) not null,
  20. expire_in number(20) default null,
  21. refresh_token varchar2(255) default null,
  22. access_code varchar2(255) default null,
  23. union_id varchar2(255) default null,
  24. scope varchar2(255) default null,
  25. token_type varchar2(255) default null,
  26. id_token varchar2(255) default null,
  27. mac_algorithm varchar2(255) default null,
  28. mac_key varchar2(255) default null,
  29. code varchar2(255) default null,
  30. oauth_token varchar2(255) default null,
  31. oauth_token_secret varchar2(255) default null,
  32. create_dept number(20),
  33. create_by number(20),
  34. create_time date,
  35. update_by number(20),
  36. update_time date,
  37. del_flag char(1) default '0'
  38. );
  39. alter table sys_social add constraint pk_sys_social primary key (id);
  40. comment on table sys_social is '社会化关系表';
  41. comment on column sys_social.id is '主键';
  42. comment on column sys_social.user_id is '用户ID';
  43. comment on column sys_social.tenant_id is '租户id';
  44. comment on column sys_social.auth_id is '平台+平台唯一id';
  45. comment on column sys_social.source is '用户来源';
  46. comment on column sys_social.open_id is '平台编号唯一id';
  47. comment on column sys_social.user_name is '登录账号';
  48. comment on column sys_social.nick_name is '用户昵称';
  49. comment on column sys_social.email is '用户邮箱';
  50. comment on column sys_social.avatar is '头像地址';
  51. comment on column sys_social.access_token is '用户的授权令牌';
  52. comment on column sys_social.expire_in is '用户的授权令牌的有效期,部分平台可能没有';
  53. comment on column sys_social.refresh_token is '刷新令牌,部分平台可能没有';
  54. comment on column sys_social.access_code is '平台的授权信息,部分平台可能没有';
  55. comment on column sys_social.union_id is '用户的 unionid';
  56. comment on column sys_social.scope is '授予的权限,部分平台可能没有';
  57. comment on column sys_social.token_type is '个别平台的授权信息,部分平台可能没有';
  58. comment on column sys_social.id_token is 'id token,部分平台可能没有';
  59. comment on column sys_social.mac_algorithm is '小米平台用户的附带属性,部分平台可能没有';
  60. comment on column sys_social.mac_key is '小米平台用户的附带属性,部分平台可能没有';
  61. comment on column sys_social.code is '用户的授权code,部分平台可能没有';
  62. comment on column sys_social.oauth_token is 'Twitter平台用户的附带属性,部分平台可能没有';
  63. comment on column sys_social.oauth_token_secret is 'Twitter平台用户的附带属性,部分平台可能没有';
  64. comment on column sys_social.create_dept is '创建部门';
  65. comment on column sys_social.create_by is '创建者';
  66. comment on column sys_social.create_time is '创建时间';
  67. comment on column sys_social.update_by is '更新者';
  68. comment on column sys_social.update_time is '更新时间';
  69. comment on column sys_social.del_flag is '删除标志(0代表存在 2代表删除)';
  70. -- ----------------------------
  71. -- 系统授权表
  72. -- ----------------------------
  73. create table sys_client (
  74. id number(20) not null,
  75. client_id varchar2(64) default null,
  76. client_key varchar2(32) default null,
  77. client_secret varchar2(255) default null,
  78. grant_type varchar2(255) default null,
  79. device_type varchar2(32) default null,
  80. active_timeout number(11) default 1800,
  81. timeout number(11) default 604800,
  82. status char(1) default '0',
  83. del_flag char(1) default '0',
  84. create_dept number(20) default null,
  85. create_by number(20) default null,
  86. create_time date,
  87. update_by number(20) default null,
  88. update_time date
  89. );
  90. alter table sys_client add constraint pk_sys_client primary key (id);
  91. comment on table sys_client is '系统授权表';
  92. comment on column sys_client.id is '主键';
  93. comment on column sys_client.client_id is '客户端id';
  94. comment on column sys_client.client_key is '客户端key';
  95. comment on column sys_client.client_secret is '客户端秘钥';
  96. comment on column sys_client.grant_type is '授权类型';
  97. comment on column sys_client.device_type is '设备类型';
  98. comment on column sys_client.active_timeout is 'token活跃超时时间';
  99. comment on column sys_client.timeout is 'token固定超时';
  100. comment on column sys_client.status is '状态(0正常 1停用)';
  101. comment on column sys_client.del_flag is '删除标志(0代表存在 2代表删除)';
  102. comment on column sys_client.create_dept is '创建部门';
  103. comment on column sys_client.create_by is '创建者';
  104. comment on column sys_client.create_time is '创建时间';
  105. comment on column sys_client.update_by is '更新者';
  106. comment on column sys_client.update_time is '更新时间';
  107. insert into sys_client values (1, 'e5cd7e4891bf95d1d19206ce24a7b32e', 'pc', 'pc123', 'password,social', 'pc', 1800, 604800, 0, 0, 103, 1, sysdate, 1, sysdate);
  108. insert into sys_client values (2, '428a8310cd442757ae699df5d894f051', 'app', 'app123', 'password,sms,social', 'android', 1800, 604800, 0, 0, 103, 1, sysdate, 1, sysdate);
  109. insert into sys_dict_type values(11, '000000', '授权类型', 'sys_grant_type', '0', 103, 1, sysdate, null, null, '认证授权类型');
  110. insert into sys_dict_type values(12, '000000', '设备类型', 'sys_device_type', '0', 103, 1, sysdate, null, null, '客户端设备类型');
  111. insert into sys_dict_data values(30, '000000', 0, '密码认证', 'password', 'sys_grant_type', '', 'default', 'N', '0', 103, 1, sysdate, null, null, '密码认证');
  112. insert into sys_dict_data values(31, '000000', 0, '短信认证', 'sms', 'sys_grant_type', '', 'default', 'N', '0', 103, 1, sysdate, null, null, '短信认证');
  113. insert into sys_dict_data values(32, '000000', 0, '邮件认证', 'email', 'sys_grant_type', '', 'default', 'N', '0', 103, 1, sysdate, null, null, '邮件认证');
  114. insert into sys_dict_data values(33, '000000', 0, '小程序认证', 'xcx', 'sys_grant_type', '', 'default', 'N', '0', 103, 1, sysdate, null, null, '小程序认证');
  115. insert into sys_dict_data values(34, '000000', 0, '三方登录认证', 'social', 'sys_grant_type', '', 'default', 'N', '0', 103, 1, sysdate, null, null, '三方登录认证');
  116. insert into sys_dict_data values(35, '000000', 0, 'PC', 'pc', 'sys_device_type', '', 'default', 'N', '0', 103, 1, sysdate, null, null, 'PC');
  117. insert into sys_dict_data values(36, '000000', 0, '安卓', 'android', 'sys_device_type', '', 'default', 'N', '0', 103, 1, sysdate, null, null, '安卓');
  118. insert into sys_dict_data values(37, '000000', 0, 'iOS', 'ios', 'sys_device_type', '', 'default', 'N', '0', 103, 1, sysdate, null, null, 'iOS');
  119. insert into sys_dict_data values(38, '000000', 0, '小程序', 'xcx', 'sys_device_type', '', 'default', 'N', '0', 103, 1, sysdate, null, null, '小程序');
  120. -- 二级菜单
  121. insert into sys_menu values('123', '客户端管理', '1', '11', 'client', 'system/client/index', '', 1, 0, 'C', '0', '0', 'system:client:list', 'international', 103, 1, sysdate, null, null, '客户端管理菜单');
  122. -- 客户端管理按钮
  123. insert into sys_menu values('1061', '客户端管理查询', '123', '1', '#', '', '', 1, 0, 'F', '0', '0', 'system:client:query', '#', 103, 1, sysdate, null, null, '');
  124. insert into sys_menu values('1062', '客户端管理新增', '123', '2', '#', '', '', 1, 0, 'F', '0', '0', 'system:client:add', '#', 103, 1, sysdate, null, null, '');
  125. insert into sys_menu values('1063', '客户端管理修改', '123', '3', '#', '', '', 1, 0, 'F', '0', '0', 'system:client:edit', '#', 103, 1, sysdate, null, null, '');
  126. insert into sys_menu values('1064', '客户端管理删除', '123', '4', '#', '', '', 1, 0, 'F', '0', '0', 'system:client:remove', '#', 103, 1, sysdate, null, null, '');
  127. insert into sys_menu values('1065', '客户端管理导出', '123', '5', '#', '', '', 1, 0, 'F', '0', '0', 'system:client:export', '#', 103, 1, sysdate, null, null, '');
  128. -- 角色菜单权限
  129. insert into sys_role_menu values ('2', '1061');
  130. insert into sys_role_menu values ('2', '1062');
  131. insert into sys_role_menu values ('2', '1063');
  132. insert into sys_role_menu values ('2', '1064');
  133. insert into sys_role_menu values ('2', '1065');
  134. update sys_dept set leader = null;
  135. ALTER TABLE sys_dept MODIFY (leader NUMBER(20))