| | |
| | | -- ---------------------------- |
| | | -- 租户表 |
| | | -- ---------------------------- |
| | | drop table if exists sys_tenant; |
| | | create table if not exists sys_tenant |
| | | ( |
| | | id int8, |
| | |
| | | -- ---------------------------- |
| | | -- 租户套餐表 |
| | | -- ---------------------------- |
| | | drop table if exists sys_tenant_package; |
| | | create table if not exists sys_tenant_package |
| | | ( |
| | | package_id int8, |
| | |
| | | -- ---------------------------- |
| | | -- 1、部门表 |
| | | -- ---------------------------- |
| | | drop table if exists sys_dept; |
| | | create table if not exists sys_dept |
| | | ( |
| | | dept_id int8, |
| | |
| | | -- ---------------------------- |
| | | -- 2、用户信息表 |
| | | -- ---------------------------- |
| | | drop table if exists sys_user; |
| | | create table if not exists sys_user |
| | | ( |
| | | user_id int8, |
| | |
| | | -- ---------------------------- |
| | | -- 3、岗位信息表 |
| | | -- ---------------------------- |
| | | drop table if exists sys_post; |
| | | create table if not exists sys_post |
| | | ( |
| | | post_id int8, |
| | |
| | | -- ---------------------------- |
| | | -- 4、角色信息表 |
| | | -- ---------------------------- |
| | | drop table if exists sys_role; |
| | | create table if not exists sys_role |
| | | ( |
| | | role_id int8, |
| | |
| | | -- 初始化-角色信息表数据 |
| | | -- ---------------------------- |
| | | insert into sys_role values('1', '000000', '超级管理员', 'superadmin', 1, '1', 't', 't', '0', '0', 103, 1, now(), null, null, '超级管理员'); |
| | | insert into sys_role values('3', '000000', '本部门及以下', 'test1', 3, '4', 't', 't', '0', '0', 103, 1, now(), 1, NULL, NULL, ''); |
| | | insert into sys_role values('4', '000000', '仅本人', 'test2', 4, '5', 't', 't', '0', '0', 103, 1, now(), 1, NULL, NULL, ''); |
| | | insert into sys_role values('3', '000000', '本部门及以下', 'test1', 3, '4', 't', 't', '0', '0', 103, 1, now(), NULL, NULL, ''); |
| | | insert into sys_role values('4', '000000', '仅本人', 'test2', 4, '5', 't', 't', '0', '0', 103, 1, now(), NULL, NULL, ''); |
| | | |
| | | -- ---------------------------- |
| | | -- 5、菜单权限表 |
| | | -- ---------------------------- |
| | | drop table if exists sys_menu; |
| | | create table if not exists sys_menu |
| | | ( |
| | | menu_id int8, |
| | |
| | | insert into sys_menu values('1064', '客户端管理删除', '123', '4', '#', '', '', '1', '0', 'F', '0', '0', 'system:client:remove', '#', 103, 1, now(), null, null, ''); |
| | | insert into sys_menu values('1065', '客户端管理导出', '123', '5', '#', '', '', '1', '0', 'F', '0', '0', 'system:client:export', '#', 103, 1, now(), null, null, ''); |
| | | -- 测试菜单 |
| | | INSERT INTO sys_menu VALUES('1500', '测试单表', '5', '1', 'demo', 'demo/demo/index', '1', '0', 'C', '0', '0', 'demo:demo:list', '#', 103, 1, now(), NULL, NULL, '测试单表菜单'); |
| | | INSERT INTO sys_menu VALUES('1501', '测试单表查询', '1500', '1', '#', '', '1', '0', 'F', '0', '0', 'demo:demo:query', '#', 103, 1, now(), NULL, NULL, ''); |
| | | INSERT INTO sys_menu VALUES('1502', '测试单表新增', '1500', '2,' '#', '', '1', '0', 'F', '0', '0', 'demo:demo:add', '#', 103, 1, now(), NULL, NULL, ''); |
| | | INSERT INTO sys_menu VALUES('1503', '测试单表修改', '1500', '3', '#', '', '1', '0,' 'F', '0', '0', 'demo:demo:edit', '#', 103, 1, now(), NULL, NULL, ''); |
| | | INSERT INTO sys_menu VALUES('1504', '测试单表删除', '1500', '4', '#', '', '1', '0', 'F', '0', '0', 'demo:demo:remove', '#', 103, 1, now(), NULL, NULL, ''); |
| | | INSERT INTO sys_menu VALUES('1505', '测试单表导出', '1500', '5', '#', '', '1', '0', 'F', '0', '0', 'demo:demo:export', '#', 103, 1, now(), NULL, NULL, ''); |
| | | INSERT INTO sys_menu VALUES('1506', '测试树表', '5', '1', 'tree', 'demo/tree/index', '1', '0', 'C', '0', '0', 'demo:tree:list', '#', 103, 1, now(), NULL, NULL, '测试树表菜单'); |
| | | INSERT INTO sys_menu VALUES('1507', '测试树表查询', '1506', '1', '#', '', '1', '0', 'F', '0', '0', 'demo:tree:query', '#', 103, 1, now(), NULL, NULL, ''); |
| | | INSERT INTO sys_menu VALUES('1508', '测试树表新增', '1506', '2', '#', '', '1', '0', 'F', '0', '0', 'demo:tree:add', '#', 103, 1, now(), NULL, NULL, ''); |
| | | INSERT INTO sys_menu VALUES('1509', '测试树表修改', '1506', '3', '#', '', '1', '0', 'F', '0', '0', 'demo:tree:edit', '#', 103, 1, now(), NULL, NULL, ''); |
| | | INSERT INTO sys_menu VALUES('1510', '测试树表删除', '1506', '4', '#', '', '1', '0', 'F', '0', '0', 'demo:tree:remove', '#', 103, 1, now(), NULL, NULL, ''); |
| | | INSERT INTO sys_menu VALUES('1511', '测试树表导出', '1506', '5', '#', '', '1', '0', 'F', '0', '0', 'demo:tree:export', '#', 103, 1, now(), NULL, NULL, ''); |
| | | INSERT INTO sys_menu VALUES('1500', '测试单表', '5', '1', 'demo', 'demo/demo/index', '', '1', '0', 'C', '0', '0', 'demo:demo:list', '#', 103, 1, now(), NULL, NULL, '测试单表菜单'); |
| | | INSERT INTO sys_menu VALUES('1501', '测试单表查询', '1500', '1', '#', '', '', '1', '0', 'F', '0', '0', 'demo:demo:query', '#', 103, 1, now(), NULL, NULL, ''); |
| | | INSERT INTO sys_menu VALUES('1502', '测试单表新增', '1500', '2,' '#', '', '', '1', '0', 'F', '0', '0', 'demo:demo:add', '#', 103, 1, now(), NULL, NULL, ''); |
| | | INSERT INTO sys_menu VALUES('1503', '测试单表修改', '1500', '3', '#', '', '', '1', '0,' 'F', '0', '0', 'demo:demo:edit', '#', 103, 1, now(), NULL, NULL, ''); |
| | | INSERT INTO sys_menu VALUES('1504', '测试单表删除', '1500', '4', '#', '', '', '1', '0', 'F', '0', '0', 'demo:demo:remove', '#', 103, 1, now(), NULL, NULL, ''); |
| | | INSERT INTO sys_menu VALUES('1505', '测试单表导出', '1500', '5', '#', '', '', '1', '0', 'F', '0', '0', 'demo:demo:export', '#', 103, 1, now(), NULL, NULL, ''); |
| | | INSERT INTO sys_menu VALUES('1506', '测试树表', '5', '1', 'tree', 'demo/tree/index', '', '1', '0', 'C', '0', '0', 'demo:tree:list', '#', 103, 1, now(), NULL, NULL, '测试树表菜单'); |
| | | INSERT INTO sys_menu VALUES('1507', '测试树表查询', '1506', '1', '#', '', '', '1', '0', 'F', '0', '0', 'demo:tree:query', '#', 103, 1, now(), NULL, NULL, ''); |
| | | INSERT INTO sys_menu VALUES('1508', '测试树表新增', '1506', '2', '#', '', '', '1', '0', 'F', '0', '0', 'demo:tree:add', '#', 103, 1, now(), NULL, NULL, ''); |
| | | INSERT INTO sys_menu VALUES('1509', '测试树表修改', '1506', '3', '#', '', '', '1', '0', 'F', '0', '0', 'demo:tree:edit', '#', 103, 1, now(), NULL, NULL, ''); |
| | | INSERT INTO sys_menu VALUES('1510', '测试树表删除', '1506', '4', '#', '', '', '1', '0', 'F', '0', '0', 'demo:tree:remove', '#', 103, 1, now(), NULL, NULL, ''); |
| | | INSERT INTO sys_menu VALUES('1511', '测试树表导出', '1506', '5', '#', '', '', '1', '0', 'F', '0', '0', 'demo:tree:export', '#', 103, 1, now(), NULL, NULL, ''); |
| | | |
| | | |
| | | -- ---------------------------- |
| | | -- 6、用户和角色关联表 用户N-1角色 |
| | | -- ---------------------------- |
| | | drop table if exists sys_user_role; |
| | | create table if not exists sys_user_role |
| | | ( |
| | | user_id int8 not null, |
| | |
| | | -- ---------------------------- |
| | | -- 7、角色和菜单关联表 角色1-N菜单 |
| | | -- ---------------------------- |
| | | drop table if exists sys_role_menu; |
| | | create table if not exists sys_role_menu |
| | | ( |
| | | role_id int8 not null, |
| | |
| | | -- ---------------------------- |
| | | -- 8、角色和部门关联表 角色1-N部门 |
| | | -- ---------------------------- |
| | | drop table if exists sys_role_dept; |
| | | create table if not exists sys_role_dept |
| | | ( |
| | | role_id int8 not null, |
| | |
| | | -- ---------------------------- |
| | | -- 9、用户与岗位关联表 用户1-N岗位 |
| | | -- ---------------------------- |
| | | drop table if exists sys_user_post; |
| | | create table if not exists sys_user_post |
| | | ( |
| | | user_id int8 not null, |
| | |
| | | -- ---------------------------- |
| | | -- 10、操作日志记录 |
| | | -- ---------------------------- |
| | | drop table if exists sys_oper_log; |
| | | create table if not exists sys_oper_log |
| | | ( |
| | | oper_id int8, |
| | |
| | | -- ---------------------------- |
| | | -- 11、字典类型表 |
| | | -- ---------------------------- |
| | | drop table if exists sys_dict_type; |
| | | create table if not exists sys_dict_type |
| | | ( |
| | | dict_id int8, |
| | |
| | | -- ---------------------------- |
| | | -- 12、字典数据表 |
| | | -- ---------------------------- |
| | | drop table if exists sys_dict_data; |
| | | create table if not exists sys_dict_data |
| | | ( |
| | | dict_code int8, |
| | |
| | | -- ---------------------------- |
| | | -- 13、参数配置表 |
| | | -- ---------------------------- |
| | | drop table if exists sys_config; |
| | | create table if not exists sys_config |
| | | ( |
| | | config_id int8, |
| | |
| | | -- ---------------------------- |
| | | -- 14、系统访问记录 |
| | | -- ---------------------------- |
| | | drop table if exists sys_logininfor; |
| | | create table if not exists sys_logininfor |
| | | ( |
| | | info_id int8, |
| | |
| | | -- ---------------------------- |
| | | -- 17、通知公告表 |
| | | -- ---------------------------- |
| | | drop table if exists sys_notice; |
| | | create table if not exists sys_notice |
| | | ( |
| | | notice_id int8, |
| | |
| | | -- ---------------------------- |
| | | -- 18、代码生成业务表 |
| | | -- ---------------------------- |
| | | drop table if exists gen_table; |
| | | create table if not exists gen_table |
| | | ( |
| | | table_id int8, |
| | |
| | | -- ---------------------------- |
| | | -- 19、代码生成业务表字段 |
| | | -- ---------------------------- |
| | | drop table if exists gen_table_column; |
| | | create table if not exists gen_table_column |
| | | ( |
| | | column_id int8, |
| | |
| | | -- ---------------------------- |
| | | -- OSS对象存储表 |
| | | -- ---------------------------- |
| | | drop table if exists sys_oss; |
| | | create table if not exists sys_oss |
| | | ( |
| | | oss_id int8, |
| | |
| | | -- ---------------------------- |
| | | -- OSS对象存储动态配置表 |
| | | -- ---------------------------- |
| | | drop table if exists sys_oss_config; |
| | | create table if not exists sys_oss_config |
| | | ( |
| | | oss_config_id int8, |
| | |
| | | -- ---------------------------- |
| | | -- 系统授权表 |
| | | -- ---------------------------- |
| | | drop table if exists sys_client; |
| | | create table sys_client ( |
| | | id int8, |
| | | client_id varchar(64) default ''::varchar, |
| | |
| | | insert into sys_client values (1, 'e5cd7e4891bf95d1d19206ce24a7b32e', 'pc', 'pc123', 'password,social', 'pc', 1800, 604800, 0, 0, 103, 1, now(), 1, now()); |
| | | insert into sys_client values (2, '428a8310cd442757ae699df5d894f051', 'app', 'app123', 'password,sms,social', 'android', 1800, 604800, 0, 0, 103, 1, now(), 1, now()); |
| | | |
| | | DROP TABLE if EXISTS test_demo; |
| | | create table if not exists test_demo |
| | | ( |
| | | id int8, |
| | |
| | | comment on column test_demo.update_by is '更新人'; |
| | | comment on column test_demo.del_flag is '删除标志'; |
| | | |
| | | DROP TABLE if EXISTS test_tree; |
| | | create table if not exists test_tree |
| | | ( |
| | | id int8, |