| | |
| | | ( |
| | | id int8 not null, |
| | | user_id int8 not null, |
| | | tenant_id varchar(20) default null::varchar, |
| | | tenant_id varchar(20) default '000000'::varchar, |
| | | auth_id varchar(255) not null, |
| | | source varchar(255) not null, |
| | | open_id varchar(255) default null::varchar, |
| | |
| | | comment on column sys_social.create_time is '创建时间'; |
| | | comment on column sys_social.update_by is '更新者'; |
| | | comment on column sys_social.update_time is '更新时间'; |
| | | comment on column sys_social.del_flag is '删除标志(0代表存在 2代表删除)'; |
| | | comment on column sys_social.del_flag is '删除标志(0代表存在 1代表删除)'; |
| | | |
| | | -- ---------------------------- |
| | | -- 租户表 |
| | | -- ---------------------------- |
| | | drop table if exists sys_tenant; |
| | | create table if not exists sys_tenant |
| | | ( |
| | | id int8, |
| | |
| | | comment on column sys_tenant.expire_time is '过期时间'; |
| | | comment on column sys_tenant.account_count is '用户数量(-1不限制)'; |
| | | comment on column sys_tenant.status is '租户状态(0正常 1停用)'; |
| | | comment on column sys_tenant.del_flag is '删除标志(0代表存在 2代表删除)'; |
| | | comment on column sys_tenant.del_flag is '删除标志(0代表存在 1代表删除)'; |
| | | comment on column sys_tenant.create_dept is '创建部门'; |
| | | comment on column sys_tenant.create_by is '创建者'; |
| | | comment on column sys_tenant.create_time is '创建时间'; |
| | |
| | | -- ---------------------------- |
| | | -- 租户套餐表 |
| | | -- ---------------------------- |
| | | drop table if exists sys_tenant_package; |
| | | create table if not exists sys_tenant_package |
| | | ( |
| | | package_id int8, |
| | |
| | | comment on column sys_tenant_package.menu_ids is '关联菜单id'; |
| | | comment on column sys_tenant_package.remark is '备注'; |
| | | comment on column sys_tenant_package.status is '状态(0正常 1停用)'; |
| | | comment on column sys_tenant_package.del_flag is '删除标志(0代表存在 2代表删除)'; |
| | | comment on column sys_tenant_package.del_flag is '删除标志(0代表存在 1代表删除)'; |
| | | comment on column sys_tenant_package.create_dept is '创建部门'; |
| | | comment on column sys_tenant_package.create_by is '创建者'; |
| | | comment on column sys_tenant_package.create_time is '创建时间'; |
| | |
| | | -- ---------------------------- |
| | | -- 1、部门表 |
| | | -- ---------------------------- |
| | | drop table if exists sys_dept; |
| | | create table if not exists sys_dept |
| | | ( |
| | | dept_id int8, |
| | |
| | | parent_id int8 default 0, |
| | | ancestors varchar(500)default ''::varchar, |
| | | dept_name varchar(30) default ''::varchar, |
| | | dept_category varchar(100) default null::varchar, |
| | | order_num int4 default 0, |
| | | leader int8 default null, |
| | | phone varchar(11) default null::varchar, |
| | |
| | | comment on column sys_dept.parent_id is '父部门ID'; |
| | | comment on column sys_dept.ancestors is '祖级列表'; |
| | | comment on column sys_dept.dept_name is '部门名称'; |
| | | comment on column sys_dept.dept_category is '部门类别编码'; |
| | | comment on column sys_dept.order_num is '显示顺序'; |
| | | comment on column sys_dept.leader is '负责人'; |
| | | comment on column sys_dept.phone is '联系电话'; |
| | | comment on column sys_dept.email is '邮箱'; |
| | | comment on column sys_dept.status is '部门状态(0正常 1停用)'; |
| | | comment on column sys_dept.del_flag is '删除标志(0代表存在 2代表删除)'; |
| | | comment on column sys_dept.del_flag is '删除标志(0代表存在 1代表删除)'; |
| | | comment on column sys_dept.create_dept is '创建部门'; |
| | | comment on column sys_dept.create_by is '创建者'; |
| | | comment on column sys_dept.create_time is '创建时间'; |
| | |
| | | -- ---------------------------- |
| | | -- 初始化-部门表数据 |
| | | -- ---------------------------- |
| | | insert into sys_dept values(100, '000000', 0, '0', 'XXX科技', 0, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); |
| | | insert into sys_dept values(101, '000000', 100, '0,100', '深圳总公司', 1, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); |
| | | insert into sys_dept values(102, '000000', 100, '0,100', '长沙分公司', 2, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); |
| | | insert into sys_dept values(103, '000000', 101, '0,100,101', '研发部门', 1, 1, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); |
| | | insert into sys_dept values(104, '000000', 101, '0,100,101', '市场部门', 2, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); |
| | | insert into sys_dept values(105, '000000', 101, '0,100,101', '测试部门', 3, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); |
| | | insert into sys_dept values(106, '000000', 101, '0,100,101', '财务部门', 4, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); |
| | | insert into sys_dept values(107, '000000', 101, '0,100,101', '运维部门', 5, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); |
| | | insert into sys_dept values(108, '000000', 102, '0,100,102', '市场部门', 1, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); |
| | | insert into sys_dept values(109, '000000', 102, '0,100,102', '财务部门', 2, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); |
| | | insert into sys_dept values(100, '000000', 0, '0', 'XXX科技', null,0, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); |
| | | insert into sys_dept values(101, '000000', 100, '0,100', '深圳总公司', null,1, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); |
| | | insert into sys_dept values(102, '000000', 100, '0,100', '长沙分公司', null,2, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); |
| | | insert into sys_dept values(103, '000000', 101, '0,100,101', '研发部门', null,1, 1, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); |
| | | insert into sys_dept values(104, '000000', 101, '0,100,101', '市场部门', null,2, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); |
| | | insert into sys_dept values(105, '000000', 101, '0,100,101', '测试部门', null,3, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); |
| | | insert into sys_dept values(106, '000000', 101, '0,100,101', '财务部门', null,4, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); |
| | | insert into sys_dept values(107, '000000', 101, '0,100,101', '运维部门', null,5, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); |
| | | insert into sys_dept values(108, '000000', 102, '0,100,102', '市场部门', null,1, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); |
| | | insert into sys_dept values(109, '000000', 102, '0,100,102', '财务部门', null,2, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, now(), null, null); |
| | | |
| | | -- ---------------------------- |
| | | -- 2、用户信息表 |
| | | -- ---------------------------- |
| | | drop table if exists sys_user; |
| | | create table if not exists sys_user |
| | | ( |
| | | user_id int8, |
| | |
| | | comment on column sys_user.avatar is '头像地址'; |
| | | comment on column sys_user.password is '密码'; |
| | | comment on column sys_user.status is '帐号状态(0正常 1停用)'; |
| | | comment on column sys_user.del_flag is '删除标志(0代表存在 2代表删除)'; |
| | | comment on column sys_user.del_flag is '删除标志(0代表存在 1代表删除)'; |
| | | comment on column sys_user.login_ip is '最后登陆IP'; |
| | | comment on column sys_user.login_date is '最后登陆时间'; |
| | | comment on column sys_user.create_dept is '创建部门'; |
| | |
| | | -- ---------------------------- |
| | | -- 3、岗位信息表 |
| | | -- ---------------------------- |
| | | drop table if exists sys_post; |
| | | create table if not exists sys_post |
| | | ( |
| | | post_id int8, |
| | | tenant_id varchar(20) default '000000'::varchar, |
| | | dept_id int8, |
| | | post_code varchar(64) not null, |
| | | post_category varchar(100) default null, |
| | | post_name varchar(50) not null, |
| | | post_sort int4 not null, |
| | | status char not null, |
| | |
| | | comment on table sys_post is '岗位信息表'; |
| | | comment on column sys_post.post_id is '岗位ID'; |
| | | comment on column sys_post.tenant_id is '租户编号'; |
| | | comment on column sys_post.dept_id is '部门id'; |
| | | comment on column sys_post.post_code is '岗位编码'; |
| | | comment on column sys_post.post_category is '岗位类别编码'; |
| | | comment on column sys_post.post_name is '岗位名称'; |
| | | comment on column sys_post.post_sort is '显示顺序'; |
| | | comment on column sys_post.status is '状态(0正常 1停用)'; |
| | |
| | | -- ---------------------------- |
| | | -- 初始化-岗位信息表数据 |
| | | -- ---------------------------- |
| | | insert into sys_post values(1, '000000', 'ceo', '董事长', 1, '0', 103, 1, now(), null, null, ''); |
| | | insert into sys_post values(2, '000000', 'se', '项目经理', 2, '0', 103, 1, now(), null, null, ''); |
| | | insert into sys_post values(3, '000000', 'hr', '人力资源', 3, '0', 103, 1, now(), null, null, ''); |
| | | insert into sys_post values(4, '000000', 'user', '普通员工', 4, '0', 103, 1, now(), null, null, ''); |
| | | insert into sys_post values(1, '000000', 103, 'ceo', null, '董事长', 1, '0', 103, 1, now(), null, null, ''); |
| | | insert into sys_post values(2, '000000', 100, 'se', null, '项目经理', 2, '0', 103, 1, now(), null, null, ''); |
| | | insert into sys_post values(3, '000000', 100, 'hr', null, '人力资源', 3, '0', 103, 1, now(), null, null, ''); |
| | | insert into sys_post values(4, '000000', 100, 'user', null, '普通员工', 4, '0', 103, 1, now(), null, null, ''); |
| | | |
| | | -- ---------------------------- |
| | | -- 4、角色信息表 |
| | | -- ---------------------------- |
| | | drop table if exists sys_role; |
| | | create table if not exists sys_role |
| | | ( |
| | | role_id int8, |
| | |
| | | comment on column sys_role.menu_check_strictly is '菜单树选择项是否关联显示'; |
| | | comment on column sys_role.dept_check_strictly is '部门树选择项是否关联显示'; |
| | | comment on column sys_role.status is '角色状态(0正常 1停用)'; |
| | | comment on column sys_role.del_flag is '删除标志(0代表存在 2代表删除)'; |
| | | comment on column sys_role.del_flag is '删除标志(0代表存在 1代表删除)'; |
| | | comment on column sys_role.create_dept is '创建部门'; |
| | | comment on column sys_role.create_by is '创建者'; |
| | | comment on column sys_role.create_time is '创建时间'; |
| | |
| | | -- 初始化-角色信息表数据 |
| | | -- ---------------------------- |
| | | 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('1', '系统管理', '0', '1', 'system', null, '', '1', '0', 'M', '0', '0', '', 'system', 103, 1, now(), null, null, '系统管理目录'); |
| | | insert into sys_menu values('6', '系统管理', '0', '2', 'tenant', null, '', '1', '0', 'M', '0', '0', '', 'chart', 103, 1, now(), null, null, '租户管理目录'); |
| | | insert into sys_menu values('6', '租户管理', '0', '2', 'tenant', null, '', '1', '0', 'M', '0', '0', '', 'chart', 103, 1, now(), null, null, '租户管理目录'); |
| | | insert into sys_menu values('2', '系统监控', '0', '3', 'monitor', null, '', '1', '0', 'M', '0', '0', '', 'monitor', 103, 1, now(), null, null, '系统监控目录'); |
| | | insert into sys_menu values('3', '系统工具', '0', '4', 'tool', null, '', '1', '0', 'M', '0', '0', '', 'tool', 103, 1, now(), null, null, '系统工具目录'); |
| | | insert into sys_menu values('4', 'PLUS官网', '0', '5', 'https://gitee.com/dromara/RuoYi-Vue-Plus', null, '', '0', '0', 'M', '0', '0', '', 'guide', 103, 1, now(), null, null, 'RuoYi-Vue-Plus官网地址'); |
| | | insert into sys_menu VALUES('5', '测试菜单', '0', '5', 'demo', null, '1', '0', 'M', '0', '0', null, 'star', 103, 1, now(), null, null, '测试菜单'); |
| | | insert into sys_menu VALUES('5', '测试菜单', '0', '5', 'demo', null, '', '1', '0', 'M', '0', '0', null, 'star', 103, 1, now(), null, null, '测试菜单'); |
| | | -- 二级菜单 |
| | | insert into sys_menu values('100', '用户管理', '1', '1', 'user', 'system/user/index', '', '1', '0', 'C', '0', '0', 'system:user:list', 'user', 103, 1, now(), null, null, '用户管理菜单'); |
| | | insert into sys_menu values('101', '角色管理', '1', '2', 'role', 'system/role/index', '', '1', '0', 'C', '0', '0', 'system:role:list', 'peoples', 103, 1, now(), null, null, '角色管理菜单'); |
| | |
| | | insert into sys_menu values('108', '日志管理', '1', '9', 'log', '', '', '1', '0', 'M', '0', '0', '', 'log', 103, 1, now(), null, null, '日志管理菜单'); |
| | | insert into sys_menu values('109', '在线用户', '2', '1', 'online', 'monitor/online/index', '', '1', '0', 'C', '0', '0', 'monitor:online:list', 'online', 103, 1, now(), null, null, '在线用户菜单'); |
| | | insert into sys_menu values('113', '缓存监控', '2', '5', 'cache', 'monitor/cache/index', '', '1', '0', 'C', '0', '0', 'monitor:cache:list', 'redis', 103, 1, now(), null, null, '缓存监控菜单'); |
| | | insert into sys_menu values('114', '表单构建', '3', '1', 'build', 'tool/build/index', '', '1', '0', 'C', '0', '0', 'tool:build:list', 'build', 103, 1, now(), null, null, '表单构建菜单'); |
| | | insert into sys_menu values('115', '代码生成', '3', '2', 'gen', 'tool/gen/index', '', '1', '0', 'C', '0', '0', 'tool:gen:list', 'code', 103, 1, now(), null, null, '代码生成菜单'); |
| | | insert into sys_menu values('121', '租户管理', '6', '1', 'tenant', 'system/tenant/index', '', '1', '0', 'C', '0', '0', 'system:tenant:list', 'list', 103, 1, now(), null, null, '租户管理菜单'); |
| | | insert into sys_menu values('122', '租户套餐管理', '6', '2', 'tenantPackage', 'system/tenantPackage/index', '', '1', '0', 'C', '0', '0', 'system:tenantPackage:list', 'form', 103, 1, now(), null, null, '租户套餐管理菜单'); |
| | |
| | | insert into sys_menu values('117', 'Admin监控', '2', '5', 'Admin', 'monitor/admin/index', '', '1', '0', 'C', '0', '0', 'monitor:admin:list', 'dashboard', 103, 1, now(), null, null, 'Admin监控菜单'); |
| | | -- oss菜单 |
| | | insert into sys_menu values('118', '文件管理', '1', '10', 'oss', 'system/oss/index', '', '1', '0', 'C', '0', '0', 'system:oss:list', 'upload', 103, 1, now(), null, null, '文件管理菜单'); |
| | | -- powerjob server控制台 |
| | | insert into sys_menu values('120', '任务调度中心', '2', '5', 'powerjob', 'monitor/powerjob/index', '', '1', '0', 'C', '0', '0', 'monitor:powerjob:list', 'job', 103, 1, now(), null, null, 'PowerJob控制台菜单'); |
| | | -- retry server控制台 |
| | | insert into sys_menu values('130', 'EasyRetry控制台', '2', '6', 'easyretry', 'monitor/easyretry/index', '', '1', '0', 'C', '0', '0', 'monitor:easyretry:list', 'job', 103, 1, now(), null, null, 'EasyRetry控制台菜单'); |
| | | -- snail-job server控制台 |
| | | insert into sys_menu values('120', '任务调度中心', '2', '6', 'snailjob', 'monitor/snailjob/index', '', '1', '0', 'C', '0', '0', 'monitor:snailjob:list', 'job', 103, 1, now(), null, null, 'SnailJob控制台菜单'); |
| | | |
| | | -- 三级菜单 |
| | | insert into sys_menu values('500', '操作日志', '108', '1', 'operlog', 'monitor/operlog/index', '', '1', '0', 'C', '0', '0', 'monitor:operlog:list', 'form', 103, 1, now(), null, null, '操作日志菜单'); |
| | |
| | | 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, |
| | |
| | | oper_url varchar(255) default ''::varchar, |
| | | oper_ip varchar(128) default ''::varchar, |
| | | oper_location varchar(255) default ''::varchar, |
| | | oper_param varchar(2000) default ''::varchar, |
| | | json_result varchar(2000) default ''::varchar, |
| | | oper_param varchar(4000) default ''::varchar, |
| | | json_result varchar(4000) default ''::varchar, |
| | | status int4 default 0, |
| | | error_msg varchar(2000) default ''::varchar, |
| | | error_msg varchar(4000) default ''::varchar, |
| | | oper_time timestamp, |
| | | cost_time int8 default 0, |
| | | constraint sys_oper_log_pk primary key (oper_id) |
| | |
| | | -- ---------------------------- |
| | | -- 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, |
| | |
| | | ); |
| | | |
| | | comment on table sys_oss_config is '对象存储配置表'; |
| | | comment on column sys_oss_config.oss_config_id is '主建'; |
| | | comment on column sys_oss_config.oss_config_id is '主键'; |
| | | comment on column sys_oss_config.tenant_id is '租户编码'; |
| | | comment on column sys_oss_config.config_key is '配置key'; |
| | | comment on column sys_oss_config.access_key is 'accessKey'; |
| | |
| | | insert into sys_oss_config values (1, '000000', 'minio', 'ruoyi', 'ruoyi123', 'ruoyi', '', '127.0.0.1:9000', '','N', '', '1', '0', '', 103, 1, now(), 1, now(), null); |
| | | insert into sys_oss_config values (2, '000000', 'qiniu', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 's3-cn-north-1.qiniucs.com', '','N', '', '1', '1', '', 103, 1, now(), 1, now(), null); |
| | | insert into sys_oss_config values (3, '000000', 'aliyun', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi', '', 'oss-cn-beijing.aliyuncs.com', '','N', '', '1', '1', '', 103, 1, now(), 1, now(), null); |
| | | insert into sys_oss_config values (4, '000000', 'qcloud', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi-1250000000', '', 'cos.ap-beijing.myqcloud.com', '','N', 'ap-beijing', '1', '1', '', 103, 1, now(), 1, now(), null); |
| | | insert into sys_oss_config values (4, '000000', 'qcloud', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi-1240000000', '', 'cos.ap-beijing.myqcloud.com', '','N', 'ap-beijing', '1', '1', '', 103, 1, now(), 1, now(), null); |
| | | insert into sys_oss_config values (5, '000000', 'image', 'ruoyi', 'ruoyi123', 'ruoyi', 'image', '127.0.0.1:9000', '','N', '', '1', '1', '', 103, 1, now(), 1, now(), NULL); |
| | | |
| | | -- ---------------------------- |
| | | -- 系统授权表 |
| | | -- ---------------------------- |
| | | drop table if exists sys_client; |
| | | create table sys_client ( |
| | | id int8, |
| | | client_id varchar(64) default ''::varchar, |
| | |
| | | ); |
| | | |
| | | comment on table sys_client is '系统授权表'; |
| | | comment on column sys_client.id is '主建'; |
| | | comment on column sys_client.id is '主键'; |
| | | comment on column sys_client.client_id is '客户端id'; |
| | | comment on column sys_client.client_key is '客户端key'; |
| | | comment on column sys_client.client_secret is '客户端秘钥'; |
| | |
| | | comment on column sys_client.active_timeout is 'token活跃超时时间'; |
| | | comment on column sys_client.timeout is 'token固定超时'; |
| | | comment on column sys_client.status is '状态(0正常 1停用)'; |
| | | comment on column sys_client.del_flag is '删除标志(0代表存在 2代表删除)'; |
| | | comment on column sys_client.del_flag is '删除标志(0代表存在 1代表删除)'; |
| | | comment on column sys_client.create_dept is '创建部门'; |
| | | comment on column sys_client.create_by is '创建者'; |
| | | comment on column sys_client.create_time is '创建时间'; |
| | |
| | | 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, |
| | |
| | | test_key varchar(255), |
| | | value varchar(255), |
| | | version int4 default 0, |
| | | create_time timestamp, |
| | | create_dept int8, |
| | | create_time timestamp, |
| | | create_by int8, |
| | | update_time timestamp, |
| | | update_by 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, |
| | |
| | | user_id int8, |
| | | tree_name varchar(255), |
| | | version int4 default 0, |
| | | create_time timestamp, |
| | | create_dept int8, |
| | | create_time timestamp, |
| | | create_by int8, |
| | | update_time timestamp, |
| | | update_by int8, |