blog-boot/sql/update.sql

780 lines
60 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- udate to Ruoyi-Flex V4.1.1:
ALTER TABLE `gen_table_column`
CHANGE COLUMN `table_id` `table_id` BIGINT NOT NULL COMMENT '归属表编号' AFTER `column_id`;
-- 测试菜单 SQL
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('测试菜单', '0', '99', 'test', null, 1, 0, 'M', '0', '0', null, 'people', 'admin', sysdate(), '', null, '测试菜单');
-- 表 demo_student 结构定义
CREATE TABLE IF NOT EXISTS `demo_student` (
`student_id` int NOT NULL AUTO_INCREMENT COMMENT '编号',
`student_name` varchar(30) COLLATE utf8mb4_bin DEFAULT '' COMMENT '学生名称',
`student_age` int DEFAULT NULL COMMENT '年龄',
`student_hobby` varchar(30) COLLATE utf8mb4_bin DEFAULT '' COMMENT '爱好0代码 1音乐 2电影',
`student_sex` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT '1' COMMENT '性别1男 2女 3未知',
`student_status` char(1) COLLATE utf8mb4_bin DEFAULT '0' COMMENT '状态0正常 1停用',
`student_birthday` datetime DEFAULT NULL COMMENT '生日',
PRIMARY KEY (`student_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='学生信息单表';
-- 学生信息单表 菜单 SQL
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('学生信息单表(mb)', '2018', '1', 'student', 'demo/student/index', 1, 0, 'C', '0', '0', 'demo:student:list', '#', 'admin', sysdate(), '', null, '学生信息单表(mb)菜单');
-- 按钮父菜单ID
SELECT @parentId := LAST_INSERT_ID();
-- 按钮 SQL
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('学生信息单表(mb)查询', @parentId, '1', '#', '', 1, 0, 'F', '0', '0', 'demo:student:query', '#', 'admin', sysdate(), '', null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('学生信息单表(mb)新增', @parentId, '2', '#', '', 1, 0, 'F', '0', '0', 'demo:student:add', '#', 'admin', sysdate(), '', null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('学生信息单表(mb)修改', @parentId, '3', '#', '', 1, 0, 'F', '0', '0', 'demo:student:edit', '#', 'admin', sysdate(), '', null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('学生信息单表(mb)删除', @parentId, '4', '#', '', 1, 0, 'F', '0', '0', 'demo:student:remove', '#', 'admin', sysdate(), '', null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('学生信息单表(mb)导出', @parentId, '5', '#', '', 1, 0, 'F', '0', '0', 'demo:student:export', '#', 'admin', sysdate(), '', null, '');
-- 树表 demo_product 结构定义
CREATE TABLE IF NOT EXISTS `demo_product` (
`product_id` bigint NOT NULL AUTO_INCREMENT COMMENT '产品id',
`parent_id` bigint DEFAULT '0' COMMENT '父产品id',
`product_name` varchar(30) COLLATE utf8mb4_bin DEFAULT '' COMMENT '产品名称',
`order_num` int DEFAULT '0' COMMENT '显示顺序',
`status` char(1) COLLATE utf8mb4_bin DEFAULT '0' COMMENT '产品状态0正常 1停用',
PRIMARY KEY (`product_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='产品表';
-- 产品树表mb菜单 SQL
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('产品树表mb', '2018', '1', 'product', 'demo/product/index', 1, 0, 'C', '0', '0', 'demo:product:list', '#', 'admin', sysdate(), '', null, '产品树表mb菜单');
-- 按钮父菜单ID
SELECT @parentId := LAST_INSERT_ID();
-- 按钮 SQL
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('产品树表mb查询', @parentId, '1', '#', '', 1, 0, 'F', '0', '0', 'demo:product:query', '#', 'admin', sysdate(), '', null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('产品树表mb新增', @parentId, '2', '#', '', 1, 0, 'F', '0', '0', 'demo:product:add', '#', 'admin', sysdate(), '', null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('产品树表mb修改', @parentId, '3', '#', '', 1, 0, 'F', '0', '0', 'demo:product:edit', '#', 'admin', sysdate(), '', null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('产品树表mb删除', @parentId, '4', '#', '', 1, 0, 'F', '0', '0', 'demo:product:remove', '#', 'admin', sysdate(), '', null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('产品树表mb导出', @parentId, '5', '#', '', 1, 0, 'F', '0', '0', 'demo:product:export', '#', 'admin', sysdate(), '', null, '');
-- 客户主表 demo_customer 结构定义
CREATE TABLE IF NOT EXISTS `demo_customer` (
`customer_id` bigint NOT NULL AUTO_INCREMENT COMMENT '客户id',
`customer_name` varchar(30) COLLATE utf8mb4_bin DEFAULT '' COMMENT '客户姓名',
`phonenumber` varchar(11) COLLATE utf8mb4_bin DEFAULT '' COMMENT '手机号码',
`sex` varchar(20) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '客户性别',
`birthday` datetime DEFAULT NULL COMMENT '客户生日',
`remark` varchar(500) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '客户描述',
PRIMARY KEY (`customer_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='客户主表';
-- 商品子表 demo_goods 结构定义
CREATE TABLE IF NOT EXISTS `demo_goods` (
`goods_id` bigint NOT NULL AUTO_INCREMENT COMMENT '商品id',
`customer_id` bigint NOT NULL COMMENT '客户id',
`name` varchar(30) COLLATE utf8mb4_bin DEFAULT '' COMMENT '商品名称',
`weight` int DEFAULT NULL COMMENT '商品重量',
`price` decimal(6,2) DEFAULT NULL COMMENT '商品价格',
`date` datetime DEFAULT NULL COMMENT '商品时间',
`type` char(1) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '商品种类',
PRIMARY KEY (`goods_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='商品子表';
-- 客户主表(mb)菜单 SQL
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('客户主表(mb)', '2018', '1', 'customer', 'demo/customer/index', 1, 0, 'C', '0', '0', 'demo:customer:list', '#', 'admin', sysdate(), '', null, '客户主表(mb)菜单');
-- 按钮父菜单ID
SELECT @parentId := LAST_INSERT_ID();
-- 按钮 SQL
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('客户主表(mb)查询', @parentId, '1', '#', '', 1, 0, 'F', '0', '0', 'demo:customer:query', '#', 'admin', sysdate(), '', null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('客户主表(mb)新增', @parentId, '2', '#', '', 1, 0, 'F', '0', '0', 'demo:customer:add', '#', 'admin', sysdate(), '', null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('客户主表(mb)修改', @parentId, '3', '#', '', 1, 0, 'F', '0', '0', 'demo:customer:edit', '#', 'admin', sysdate(), '', null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('客户主表(mb)删除', @parentId, '4', '#', '', 1, 0, 'F', '0', '0', 'demo:customer:remove', '#', 'admin', sysdate(), '', null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('客户主表(mb)导出', @parentId, '5', '#', '', 1, 0, 'F', '0', '0', 'demo:customer:export', '#', 'admin', sysdate(), '', null, '');
-- 插入gen_table数据
INSERT INTO `gen_table` (`table_id`, `table_name`, `table_comment`, `sub_table_name`, `sub_table_fk_name`, `class_name`, `tpl_category`, `package_name`, `module_name`, `business_name`, `function_name`, `function_author`, `gen_type`, `gen_path`, `options`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES
(1, 'demo_student', '学生信息表', NULL, NULL, 'DemoStudent', 'crud', 'com.ruoyi.demo', 'demo', 'student', '学生信息单表(mb)', '数据小王子', '0', '/', '{"parentMenuId":"2018"}', 'admin', '2023-06-03 21:44:19', '', '2023-07-09 12:14:53', '生成mybatis语法单表代码'),
(2, 'demo_product', '产品树表', '', '', 'DemoProduct', 'tree', 'com.ruoyi.demo', 'demo', 'product', '产品树表mb', '数据小王子', '0', '/', '{"treeCode":"product_id","treeName":"product_name","treeParentCode":"parent_id","parentMenuId":"2018"}', 'admin', '2023-06-04 21:22:27', '', '2023-07-09 20:56:08', '生成mybatis语法树表代码'),
(3, 'demo_customer', '客户主表', 'demo_goods', 'customer_id', 'DemoCustomer', 'sub', 'com.ruoyi.demo', 'demo', 'customer', '客户主表(mb)', '数据小王子', '0', '/', '{"parentMenuId":"2018"}', 'admin', '2023-06-04 21:43:20', '', '2023-07-11 15:49:51', '生成mybatis语法主子表代码'),
(12, 'demo_goods', '商品子表', NULL, NULL, 'DemoGoods', 'crud', 'com.ruoyi.demo', 'demo', 'goods', '商品子', '数据小王子', '0', '/', NULL, 'admin', '2023-07-11 15:52:15', '', NULL, NULL);
-- 插入gen_table_column数据
INSERT INTO `gen_table_column` (`column_id`, `table_id`, `column_name`, `column_comment`, `column_type`, `java_type`, `java_field`, `is_pk`, `is_increment`, `is_required`, `is_insert`, `is_edit`, `is_list`, `is_query`, `query_type`, `html_type`, `dict_type`, `sort`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES
(1, 1, 'student_id', '编号', 'int', 'Long', 'studentId', '1', '1', NULL, '1', NULL, NULL, NULL, 'EQ', 'input', '', 1, 'admin', '2023-06-03 21:44:19', '', '2023-07-09 12:14:53'),
(2, 1, 'student_name', '学生名称', 'varchar(30)', 'String', 'studentName', '0', '0', '1', '1', '1', '1', '1', 'LIKE', 'input', '', 2, 'admin', '2023-06-03 21:44:19', '', '2023-07-09 12:14:53'),
(3, 1, 'student_age', '年龄', 'int', 'Long', 'studentAge', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 3, 'admin', '2023-06-03 21:44:19', '', '2023-07-09 12:14:53'),
(4, 1, 'student_hobby', '爱好0代码 1音乐 2电影', 'varchar(30)', 'String', 'studentHobby', '0', '0', '1', '1', '1', '1', '0', 'EQ', 'select', 'sys_student_hobby', 4, 'admin', '2023-06-03 21:44:19', '', '2023-07-09 12:14:53'),
(5, 1, 'student_sex', '性别1男 2女 3未知', 'char(1)', 'String', 'studentSex', '0', '0', '1', '1', '1', '1', '0', 'EQ', 'select', 'sys_user_sex', 5, 'admin', '2023-06-03 21:44:19', '', '2023-07-09 12:14:53'),
(6, 1, 'student_status', '状态0正常 1停用', 'char(1)', 'String', 'studentStatus', '0', '0', '1', '1', '1', '1', '0', 'EQ', 'radio', 'sys_student_status', 6, 'admin', '2023-06-03 21:44:19', '', '2023-07-09 12:14:53'),
(7, 1, 'student_birthday', '生日', 'datetime', 'Date', 'studentBirthday', '0', '0', '1', '1', '1', '1', '0', 'EQ', 'datetime', '', 7, 'admin', '2023-06-03 21:44:19', '', '2023-07-09 12:14:53'),
(8, 2, 'product_id', '产品id', 'bigint', 'Long', 'productId', '1', '1', NULL, '1', NULL, NULL, NULL, 'EQ', 'input', '', 1, 'admin', '2023-06-04 21:22:27', '', '2023-07-09 20:56:08'),
(9, 2, 'parent_id', '父产品id', 'bigint', 'Long', 'parentId', '0', '0', NULL, '1', '1', '0', '0', 'EQ', 'input', '', 2, 'admin', '2023-06-04 21:22:27', '', '2023-07-09 20:56:08'),
(10, 2, 'product_name', '产品名称', 'varchar(30)', 'String', 'productName', '0', '0', NULL, '1', '1', '1', '1', 'LIKE', 'input', '', 3, 'admin', '2023-06-04 21:22:27', '', '2023-07-09 20:56:08'),
(11, 2, 'order_num', '', 'int', 'Long', 'orderNum', '0', '0', NULL, '1', '1', '0', '0', 'EQ', 'input', '', 4, 'admin', '2023-06-04 21:22:27', '', '2023-07-09 20:56:08'),
(12, 2, 'status', '0 1', 'char(1)', 'String', 'status', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'select', 'sys_common_status', 5, 'admin', '2023-06-04 21:22:27', '', '2023-07-09 20:56:08'),
(13, 3, 'customer_id', 'id', 'bigint', 'Long', 'customerId', '1', '1', NULL, '1', NULL, NULL, NULL, 'EQ', 'input', '', 1, 'admin', '2023-06-04 21:43:20', '', '2023-07-11 15:49:51'),
(14, 3, 'customer_name', '', 'varchar(30)', 'String', 'customerName', '0', '0', NULL, '1', '1', '1', '1', 'LIKE', 'input', '', 2, 'admin', '2023-06-04 21:43:20', '', '2023-07-11 15:49:51'),
(15, 3, 'phonenumber', '', 'varchar(11)', 'String', 'phonenumber', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 3, 'admin', '2023-06-04 21:43:20', '', '2023-07-11 15:49:51'),
(16, 3, 'sex', '', 'varchar(20)', 'String', 'sex', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'select', 'sys_user_sex', 4, 'admin', '2023-06-04 21:43:20', '', '2023-07-11 15:49:51'),
(17, 3, 'birthday', '', 'datetime', 'Date', 'birthday', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'datetime', '', 5, 'admin', '2023-06-04 21:43:20', '', '2023-07-11 15:49:51'),
(18, 3, 'remark', '', 'varchar(500)', 'String', 'remark', '0', '0', NULL, '1', '1', '1', NULL, 'EQ', 'textarea', '', 6, 'admin', '2023-06-04 21:43:20', '', '2023-07-11 15:49:51'),
(67, 12, 'goods_id', 'id', 'bigint', 'Long', 'goodsId', '1', '1', NULL, NULL, NULL, NULL, NULL, 'EQ', 'input', '', 1, 'admin', '2023-07-11 15:52:15', '', NULL),
(68, 12, 'customer_id', 'id', 'bigint', 'Long', 'customerId', '0', '0', '1', '1', '1', '1', '1', 'EQ', 'input', '', 2, 'admin', '2023-07-11 15:52:15', '', NULL),
(69, 12, 'name', '', 'varchar(30)', 'String', 'name', '0', '0', NULL, '1', '1', '1', '1', 'LIKE', 'input', '', 3, 'admin', '2023-07-11 15:52:15', '', NULL),
(70, 12, 'weight', '', 'int', 'Long', 'weight', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 4, 'admin', '2023-07-11 15:52:15', '', NULL),
(71, 12, 'price', '', 'decimal(6,2)', 'BigDecimal', 'price', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'input', '', 5, 'admin', '2023-07-11 15:52:15', '', NULL),
(72, 12, 'date', '', 'datetime', 'Date', 'date', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'datetime', '', 6, 'admin', '2023-07-11 15:52:15', '', NULL),
(73, 12, 'type', '', 'char(1)', 'String', 'type', '0', '0', NULL, '1', '1', '1', '1', 'EQ', 'select', '', 7, 'admin', '2023-07-11 15:52:15', '', NULL);
-- udate to Ruoyi-Flex V4.1.2: 删除druid
delete FROM sys_menu where menu_id=111;
-- udate to Ruoyi-Flex V4.1.3: 将“系统接口”设置为外链
update sys_menu SET path="http://localhost:8080/swagger-ui/index.html", component = "", is_frame = "0", menu_type = "M" where menu_id = 117;
-- udate to Ruoyi-Flex V4.1.4: 添加sys_client系统授权表
drop table if exists sys_client;
create table sys_client (
id bigint(20) not null comment 'id',
client_id varchar(64) default null comment 'id',
client_key varchar(32) default null comment 'key',
client_secret varchar(255) default null comment '',
grant_type varchar(255) default null comment '',
device_type varchar(32) default null comment '',
active_timeout int(11) default 1800 comment 'token活跃超时时间',
timeout int(11) default 604800 comment 'token固定超时',
status char(1) default '0' comment '0 1',
del_flag char(1) default '0' comment '0 2',
create_dept bigint(20) default null comment '',
create_by bigint(20) default null comment '',
create_time datetime default null comment '',
update_by bigint(20) default null comment '',
update_time datetime default null comment '',
`remark` VARCHAR(250) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_bin',
primary key (id)
) engine=innodb comment='';
insert into sys_client values (1, 'e5cd7e4891bf95d1d19206ce24a7b32e', 'pc', 'pc123', 'password,social', 'pc', 1800, 604800, 0, 0, 103, 1, sysdate(), 1, sysdate(),'');
insert into sys_client values (2, '428a8310cd442757ae699df5d894f051', 'app', 'app123', 'password,sms,social', 'android', 1800, 604800, 0, 0, 103, 1, sysdate(), 1, sysdate(),'');
-- 删除status列
ALTER TABLE `sys_dict_data` DROP COLUMN `status`;
ALTER TABLE `sys_dict_type` DROP COLUMN `status`;
UPDATE sys_job SET create_by=1,update_by=1;
ALTER TABLE `sys_job`
CHANGE COLUMN `create_by` `create_by` BIGINT NOT NULL DEFAULT '0' COMMENT '' AFTER `status`,
CHANGE COLUMN `update_by` `update_by` BIGINT NOT NULL DEFAULT '0' COMMENT '' AFTER `create_time`;
-- 表 sys_tenant 结构
CREATE TABLE IF NOT EXISTS `sys_tenant` (
`id` bigint NOT NULL COMMENT 'id',
`tenant_id` bigint NOT NULL COMMENT '',
`contact_user_name` varchar(20) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '',
`contact_phone` varchar(20) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '',
`company_name` varchar(50) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '',
`license_number` varchar(30) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '',
`address` varchar(200) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '',
`intro` varchar(200) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '',
`domain` varchar(200) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '',
`remark` varchar(200) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '',
`package_id` bigint DEFAULT NULL COMMENT '',
`expire_time` datetime DEFAULT NULL COMMENT '',
`account_count` int DEFAULT '-1' COMMENT '-1',
`status` char(1) COLLATE utf8mb4_bin DEFAULT '0' COMMENT '0 1',
`del_flag` char(1) COLLATE utf8mb4_bin DEFAULT '0' COMMENT '0 2',
`create_dept` bigint DEFAULT NULL COMMENT '',
`create_by` bigint DEFAULT NULL COMMENT '',
`create_time` datetime DEFAULT NULL COMMENT '',
`update_by` bigint DEFAULT NULL COMMENT '',
`update_time` datetime DEFAULT NULL COMMENT '',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='';
-- 表sys_tenant 的数据
INSERT INTO `sys_tenant` (`id`, `tenant_id`, `contact_user_name`, `contact_phone`, `company_name`, `license_number`, `address`, `intro`, `domain`, `remark`, `package_id`, `expire_time`, `account_count`, `status`, `del_flag`, `create_dept`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES
(1, 1, '', '18888888888', 'XXX有限公司', NULL, NULL, 'RuoYi-Flex多租户通用后台管理管理系统', NULL, NULL, NULL, NULL, -1, '0', '0', 103, 1, '2023-08-13 08:08:08', NULL, NULL);
ALTER TABLE `sys_user`
ADD COLUMN `tenant_id` BIGINT(19) NOT NULL DEFAULT '0' COMMENT '' AFTER `user_id`;
UPDATE sys_user SET tenant_id=1;
UPDATE sys_user SET create_by=1,update_by=1;
ALTER TABLE `sys_user`
CHANGE COLUMN `create_by` `create_by` BIGINT NOT NULL DEFAULT '0' COMMENT '' AFTER `login_date`,
CHANGE COLUMN `update_by` `update_by` BIGINT NOT NULL DEFAULT '0' COMMENT '' AFTER `create_time`;
UPDATE sys_role SET create_by=1,update_by=1;
ALTER TABLE `sys_role`
CHANGE COLUMN `create_by` `create_by` BIGINT NOT NULL DEFAULT '0' COMMENT '' AFTER `del_flag`,
CHANGE COLUMN `update_by` `update_by` BIGINT NOT NULL DEFAULT '0' COMMENT '' AFTER `create_time`;
UPDATE sys_post SET create_by=1,update_by=1;
ALTER TABLE `sys_post`
CHANGE COLUMN `create_by` `create_by` BIGINT NOT NULL DEFAULT '0' COMMENT '' AFTER `status`,
CHANGE COLUMN `update_by` `update_by` BIGINT NOT NULL DEFAULT '0' COMMENT '' AFTER `create_time`;
UPDATE sys_notice SET create_by=1,update_by=1;
ALTER TABLE `sys_notice`
CHANGE COLUMN `create_by` `create_by` BIGINT NOT NULL DEFAULT '0' COMMENT '' AFTER `status`,
CHANGE COLUMN `update_by` `update_by` BIGINT NOT NULL DEFAULT '0' COMMENT '' AFTER `create_time`;
UPDATE sys_menu SET create_by=1,update_by=1;
ALTER TABLE `sys_menu`
CHANGE COLUMN `create_by` `create_by` BIGINT NOT NULL DEFAULT '0' COMMENT '' AFTER `icon`,
CHANGE COLUMN `update_by` `update_by` BIGINT NOT NULL DEFAULT '0' COMMENT '' AFTER `create_time`;
UPDATE sys_dict_type SET create_by=1,update_by=1;
ALTER TABLE `sys_dict_type`
CHANGE COLUMN `create_by` `create_by` BIGINT NOT NULL DEFAULT '0' COMMENT '' AFTER `dict_type`,
CHANGE COLUMN `update_by` `update_by` BIGINT NOT NULL DEFAULT '0' COMMENT '' AFTER `create_time`;
UPDATE sys_dict_data SET create_by=1,update_by=1;
ALTER TABLE `sys_dict_data`
CHANGE COLUMN `create_by` `create_by` BIGINT NOT NULL DEFAULT '0' COMMENT '' AFTER `is_default`,
CHANGE COLUMN `update_by` `update_by` BIGINT NOT NULL DEFAULT '0' COMMENT '' AFTER `create_time`;
UPDATE sys_dept SET create_by=1,update_by=1;
ALTER TABLE `sys_dept`
CHANGE COLUMN `create_by` `create_by` BIGINT NOT NULL DEFAULT '0' COMMENT '' AFTER `del_flag`,
CHANGE COLUMN `update_by` `update_by` BIGINT NOT NULL DEFAULT '0' COMMENT '' AFTER `create_time`;
UPDATE sys_config SET create_by=1,update_by=1;
ALTER TABLE `sys_config`
CHANGE COLUMN `create_by` `create_by` BIGINT NOT NULL DEFAULT '0' COMMENT '' AFTER `config_type`,
CHANGE COLUMN `update_by` `update_by` BIGINT NOT NULL DEFAULT '0' COMMENT '' AFTER `create_time`;
UPDATE gen_table_column SET create_by=1,update_by=1;
ALTER TABLE `gen_table_column`
CHANGE COLUMN `create_by` `create_by` BIGINT NOT NULL DEFAULT '0' COMMENT '' AFTER `sort`,
CHANGE COLUMN `update_by` `update_by` BIGINT NOT NULL DEFAULT '0' COMMENT '' AFTER `create_time`;
UPDATE gen_table SET create_by=1,update_by=1;
ALTER TABLE `gen_table`
CHANGE COLUMN `create_by` `create_by` BIGINT NOT NULL DEFAULT '0' COMMENT '' AFTER `options`,
CHANGE COLUMN `update_by` `update_by` BIGINT NOT NULL DEFAULT '0' COMMENT '' AFTER `create_time`;
ALTER TABLE `sys_user`
CHANGE COLUMN `user_type` `user_type` VARCHAR(10) NULL DEFAULT '00' COMMENT '00' COLLATE 'utf8mb4_bin' AFTER `nick_name`;
UPDATE sys_user SET user_type="sys_user";
delete FROM sys_menu WHERE menu_name = "缓存列表";
-- “服务监控”菜单使用SpringBoot-Admin监控框架
UPDATE `sys_menu` SET `path`='admin', `component`='monitor/admin/index', `perms`='monitor:admin:list' WHERE `menu_id`=112;
-- update to V4.1.6
-- ----------------------------
-- Table structure for pj_app_info
-- ----------------------------
DROP TABLE IF EXISTS `pj_app_info`;
CREATE TABLE `pj_app_info` (
`id` bigint(0) NOT NULL AUTO_INCREMENT,
`app_name` varchar(255) NULL DEFAULT NULL,
`current_server` varchar(255) NULL DEFAULT NULL,
`gmt_create` datetime(6) NULL DEFAULT NULL,
`gmt_modified` datetime(6) NULL DEFAULT NULL,
`password` varchar(255) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `uidx01_app_info`(`app_name`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of pj_app_info
-- ----------------------------
INSERT INTO `pj_app_info` VALUES (1, 'ruoyi-worker', '127.0.0.1:10010', '2023-06-13 16:32:59.263000', '2023-07-04 17:25:49.798000', '123456');
-- ----------------------------
-- Table structure for pj_container_info
-- ----------------------------
DROP TABLE IF EXISTS `pj_container_info`;
CREATE TABLE `pj_container_info` (
`id` bigint(0) NOT NULL AUTO_INCREMENT,
`app_id` bigint(0) NULL DEFAULT NULL,
`container_name` varchar(255) NULL DEFAULT NULL,
`gmt_create` datetime(6) NULL DEFAULT NULL,
`gmt_modified` datetime(6) NULL DEFAULT NULL,
`last_deploy_time` datetime(6) NULL DEFAULT NULL,
`source_info` varchar(255) NULL DEFAULT NULL,
`source_type` int(0) NULL DEFAULT NULL,
`status` int(0) NULL DEFAULT NULL,
`version` varchar(255) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx01_container_info`(`app_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for pj_instance_info
-- ----------------------------
DROP TABLE IF EXISTS `pj_instance_info`;
CREATE TABLE `pj_instance_info` (
`id` bigint(0) NOT NULL AUTO_INCREMENT,
`actual_trigger_time` bigint(0) NULL DEFAULT NULL,
`app_id` bigint(0) NULL DEFAULT NULL,
`expected_trigger_time` bigint(0) NULL DEFAULT NULL,
`finished_time` bigint(0) NULL DEFAULT NULL,
`gmt_create` datetime(6) NULL DEFAULT NULL,
`gmt_modified` datetime(6) NULL DEFAULT NULL,
`instance_id` bigint(0) NULL DEFAULT NULL,
`instance_params` longtext NULL,
`job_id` bigint(0) NULL DEFAULT NULL,
`job_params` longtext NULL,
`last_report_time` bigint(0) NULL DEFAULT NULL,
`result` longtext NULL,
`running_times` bigint(0) NULL DEFAULT NULL,
`status` int(0) NULL DEFAULT NULL,
`task_tracker_address` varchar(255) NULL DEFAULT NULL,
`type` int(0) NULL DEFAULT NULL,
`wf_instance_id` bigint(0) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx01_instance_info`(`job_id`, `status`) USING BTREE,
INDEX `idx02_instance_info`(`app_id`, `status`) USING BTREE,
INDEX `idx03_instance_info`(`instance_id`, `status`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for pj_job_info
-- ----------------------------
DROP TABLE IF EXISTS `pj_job_info`;
CREATE TABLE `pj_job_info` (
`id` bigint(0) NOT NULL AUTO_INCREMENT,
`alarm_config` varchar(255) NULL DEFAULT NULL,
`app_id` bigint(0) NULL DEFAULT NULL,
`concurrency` int(0) NULL DEFAULT NULL,
`designated_workers` varchar(255) NULL DEFAULT NULL,
`dispatch_strategy` int(0) NULL DEFAULT NULL,
`execute_type` int(0) NULL DEFAULT NULL,
`extra` varchar(255) NULL DEFAULT NULL,
`gmt_create` datetime(6) NULL DEFAULT NULL,
`gmt_modified` datetime(6) NULL DEFAULT NULL,
`instance_retry_num` int(0) NULL DEFAULT NULL,
`instance_time_limit` bigint(0) NULL DEFAULT NULL,
`job_description` varchar(255) NULL DEFAULT NULL,
`job_name` varchar(255) NULL DEFAULT NULL,
`job_params` longtext NULL,
`lifecycle` varchar(255) NULL DEFAULT NULL,
`log_config` varchar(255) NULL DEFAULT NULL,
`max_instance_num` int(0) NULL DEFAULT NULL,
`max_worker_count` int(0) NULL DEFAULT NULL,
`min_cpu_cores` double NOT NULL,
`min_disk_space` double NOT NULL,
`min_memory_space` double NOT NULL,
`next_trigger_time` bigint(0) NULL DEFAULT NULL,
`notify_user_ids` varchar(255) NULL DEFAULT NULL,
`processor_info` varchar(255) NULL DEFAULT NULL,
`processor_type` int(0) NULL DEFAULT NULL,
`status` int(0) NULL DEFAULT NULL,
`tag` varchar(255) NULL DEFAULT NULL,
`task_retry_num` int(0) NULL DEFAULT NULL,
`time_expression` varchar(255) NULL DEFAULT NULL,
`time_expression_type` int(0) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx01_job_info`(`app_id`, `status`, `time_expression_type`, `next_trigger_time`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of pj_job_info
-- ----------------------------
INSERT INTO `pj_job_info` VALUES (1, '{\"alertThreshold\":0,\"silenceWindowLen\":0,\"statisticWindowLen\":0}', 1, 5, '', 2, 1, NULL, '2023-06-02 15:01:27.717000', '2023-07-04 17:22:12.374000', 1, 0, '', '', NULL, '{}', '{\"type\":1}', 0, 0, 0, 0, 0, NULL, NULL, 'org.dromara.job.processors.StandaloneProcessorDemo', 1, 2, NULL, 1, '30000', 3);
INSERT INTO `pj_job_info` VALUES (2, '{\"alertThreshold\":0,\"silenceWindowLen\":0,\"statisticWindowLen\":0}', 1, 5, '', 1, 2, NULL, '2023-06-02 15:04:45.342000', '2023-07-04 17:22:12.816000', 0, 0, NULL, '广', NULL, '{}', '{\"type\":1}', 0, 0, 0, 0, 0, NULL, NULL, 'org.dromara.job.processors.BroadcastProcessorDemo', 1, 2, NULL, 1, '30000', 3);
INSERT INTO `pj_job_info` VALUES (3, '{\"alertThreshold\":0,\"silenceWindowLen\":0,\"statisticWindowLen\":0}', 1, 5, '', 1, 4, NULL, '2023-06-02 15:13:23.519000', '2023-06-02 16:03:22.421000', 0, 0, NULL, 'Map处理器测试', NULL, '{}', '{\"type\":1}', 0, 0, 0, 0, 0, NULL, NULL, 'org.dromara.job.processors.MapProcessorDemo', 1, 2, NULL, 1, '1000', 3);
INSERT INTO `pj_job_info` VALUES (4, '{\"alertThreshold\":0,\"silenceWindowLen\":0,\"statisticWindowLen\":0}', 1, 5, '', 1, 3, NULL, '2023-06-02 15:45:25.896000', '2023-06-02 16:03:23.125000', 0, 0, NULL, 'MapReduce处理器测试', NULL, '{}', '{\"type\":1}', 0, 0, 0, 0, 0, NULL, NULL, 'org.dromara.job.processors.MapReduceProcessorDemo', 1, 2, NULL, 1, '1000', 3);
-- ----------------------------
-- Table structure for pj_oms_lock
-- ----------------------------
DROP TABLE IF EXISTS `pj_oms_lock`;
CREATE TABLE `pj_oms_lock` (
`id` bigint(0) NOT NULL AUTO_INCREMENT,
`gmt_create` datetime(6) NULL DEFAULT NULL,
`gmt_modified` datetime(6) NULL DEFAULT NULL,
`lock_name` varchar(255) NULL DEFAULT NULL,
`max_lock_time` bigint(0) NULL DEFAULT NULL,
`ownerip` varchar(255) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `uidx01_oms_lock`(`lock_name`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6 ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for pj_server_info
-- ----------------------------
DROP TABLE IF EXISTS `pj_server_info`;
CREATE TABLE `pj_server_info` (
`id` bigint(0) NOT NULL AUTO_INCREMENT,
`gmt_create` datetime(6) NULL DEFAULT NULL,
`gmt_modified` datetime(6) NULL DEFAULT NULL,
`ip` varchar(255) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `uidx01_server_info`(`ip`) USING BTREE,
INDEX `idx01_server_info`(`gmt_modified`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for pj_user_info
-- ----------------------------
DROP TABLE IF EXISTS `pj_user_info`;
CREATE TABLE `pj_user_info` (
`id` bigint(0) NOT NULL AUTO_INCREMENT,
`email` varchar(255) NULL DEFAULT NULL,
`extra` varchar(255) NULL DEFAULT NULL,
`gmt_create` datetime(6) NULL DEFAULT NULL,
`gmt_modified` datetime(6) NULL DEFAULT NULL,
`password` varchar(255) NULL DEFAULT NULL,
`phone` varchar(255) NULL DEFAULT NULL,
`username` varchar(255) NULL DEFAULT NULL,
`web_hook` varchar(255) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
INDEX `uidx01_user_info`(`username`) USING BTREE,
INDEX `uidx02_user_info`(`email`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for pj_workflow_info
-- ----------------------------
DROP TABLE IF EXISTS `pj_workflow_info`;
CREATE TABLE `pj_workflow_info` (
`id` bigint(0) NOT NULL AUTO_INCREMENT,
`app_id` bigint(0) NULL DEFAULT NULL,
`extra` varchar(255) NULL DEFAULT NULL,
`gmt_create` datetime(6) NULL DEFAULT NULL,
`gmt_modified` datetime(6) NULL DEFAULT NULL,
`lifecycle` varchar(255) NULL DEFAULT NULL,
`max_wf_instance_num` int(0) NULL DEFAULT NULL,
`next_trigger_time` bigint(0) NULL DEFAULT NULL,
`notify_user_ids` varchar(255) NULL DEFAULT NULL,
`pedag` longtext NULL,
`status` int(0) NULL DEFAULT NULL,
`time_expression` varchar(255) NULL DEFAULT NULL,
`time_expression_type` int(0) NULL DEFAULT NULL,
`wf_description` varchar(255) NULL DEFAULT NULL,
`wf_name` varchar(255) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx01_workflow_info`(`app_id`, `status`, `time_expression_type`, `next_trigger_time`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for pj_workflow_instance_info
-- ----------------------------
DROP TABLE IF EXISTS `pj_workflow_instance_info`;
CREATE TABLE `pj_workflow_instance_info` (
`id` bigint(0) NOT NULL AUTO_INCREMENT,
`actual_trigger_time` bigint(0) NULL DEFAULT NULL,
`app_id` bigint(0) NULL DEFAULT NULL,
`dag` longtext NULL,
`expected_trigger_time` bigint(0) NULL DEFAULT NULL,
`finished_time` bigint(0) NULL DEFAULT NULL,
`gmt_create` datetime(6) NULL DEFAULT NULL,
`gmt_modified` datetime(6) NULL DEFAULT NULL,
`parent_wf_instance_id` bigint(0) NULL DEFAULT NULL,
`result` longtext NULL,
`status` int(0) NULL DEFAULT NULL,
`wf_context` longtext NULL,
`wf_init_params` longtext NULL,
`wf_instance_id` bigint(0) NULL DEFAULT NULL,
`workflow_id` bigint(0) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `uidx01_wf_instance`(`wf_instance_id`) USING BTREE,
INDEX `idx01_wf_instance`(`workflow_id`, `status`, `app_id`, `expected_trigger_time`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for pj_workflow_node_info
-- ----------------------------
DROP TABLE IF EXISTS `pj_workflow_node_info`;
CREATE TABLE `pj_workflow_node_info` (
`id` bigint(0) NOT NULL AUTO_INCREMENT,
`app_id` bigint(0) NOT NULL,
`enable` bit(1) NOT NULL,
`extra` longtext NULL,
`gmt_create` datetime(6) NULL,
`gmt_modified` datetime(6) NULL,
`job_id` bigint(0) NULL DEFAULT NULL,
`node_name` varchar(255) NULL DEFAULT NULL,
`node_params` longtext NULL,
`skip_when_failed` bit(1) NOT NULL,
`type` int(0) NULL DEFAULT NULL,
`workflow_id` bigint(0) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx01_workflow_node_info`(`workflow_id`, `gmt_create`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
-- “定时任务”菜单修改为“任务调度”使用powerjob
UPDATE `sys_menu` SET `menu_name`='',`path`='powerjob', `component`='monitor/powerjob/index', `perms`='monitor:powerjob:list' WHERE `menu_id`=110;
-- 删除quartz数据库表
DROP TABLE IF EXISTS QRTZ_FIRED_TRIGGERS;
DROP TABLE IF EXISTS QRTZ_PAUSED_TRIGGER_GRPS;
DROP TABLE IF EXISTS QRTZ_SCHEDULER_STATE;
DROP TABLE IF EXISTS QRTZ_LOCKS;
DROP TABLE IF EXISTS QRTZ_SIMPLE_TRIGGERS;
DROP TABLE IF EXISTS QRTZ_SIMPROP_TRIGGERS;
DROP TABLE IF EXISTS QRTZ_CRON_TRIGGERS;
DROP TABLE IF EXISTS QRTZ_BLOB_TRIGGERS;
DROP TABLE IF EXISTS QRTZ_TRIGGERS;
DROP TABLE IF EXISTS QRTZ_JOB_DETAILS;
DROP TABLE IF EXISTS QRTZ_CALENDARS;
-- V4.1.7升级到V4.1.8:
-- 修改字典"sys_user_sex"为"sys_user_gender"
UPDATE sys_dict_data SET `dict_type`="sys_user_gender" WHERE `dict_type`="sys_user_sex";
UPDATE sys_dict_type SET `dict_type`="sys_user_gender" WHERE `dict_type`="sys_user_sex";
UPDATE gen_table_column SET `dict_type`="sys_user_gender" WHERE `dict_type`="sys_user_sex";
-- 修改用户表"sex"字段为"gender"
ALTER TABLE `sys_user` CHANGE COLUMN `sex` `gender` CHAR(1) NULL DEFAULT '0' COMMENT '0 1 2' COLLATE 'utf8mb4_bin' AFTER `phonenumber`;
ALTER TABLE `sys_dept`
CHANGE COLUMN `del_flag` `del_flag` CHAR(1) NULL DEFAULT '0' COMMENT '0 1' COLLATE 'utf8mb4_bin' AFTER `status`;
-- 数据库表去掉自增主键:
ALTER TABLE `sys_role`
CHANGE COLUMN `role_id` `role_id` BIGINT(19) NOT NULL COMMENT 'ID' FIRST;
ALTER TABLE `sys_config`
CHANGE COLUMN `config_id` `config_id` BIGINT(19) NOT NULL COMMENT '' FIRST;
ALTER TABLE `sys_notice`
CHANGE COLUMN `notice_id` `notice_id` BIGINT(19) NOT NULL COMMENT 'ID' FIRST;
ALTER TABLE `sys_post`
CHANGE COLUMN `post_id` `post_id` BIGINT(19) NOT NULL COMMENT 'ID' FIRST;
ALTER TABLE `sys_dict_type`
CHANGE COLUMN `dict_id` `dict_id` BIGINT(19) NOT NULL COMMENT '' FIRST;
ALTER TABLE `sys_dict_data`
CHANGE COLUMN `dict_code` `dict_code` BIGINT(19) NOT NULL COMMENT '' FIRST;
ALTER TABLE `sys_dept`
CHANGE COLUMN `dept_id` `dept_id` BIGINT(19) NOT NULL COMMENT 'id' FIRST;
ALTER TABLE `sys_dept`
CHANGE COLUMN `ancestors` `ancestors` VARCHAR(760) NULL DEFAULT '' COMMENT '' COLLATE 'utf8mb4_bin' AFTER `parent_id`;
ALTER TABLE `sys_user`
CHANGE COLUMN `user_id` `user_id` BIGINT(19) NOT NULL COMMENT 'ID' FIRST;
ALTER TABLE `sys_user`
CHANGE COLUMN `user_type` `user_type` VARCHAR(10) NULL DEFAULT 'sys_user' COMMENT 'sys_user系统用户app_user App用户' COLLATE 'utf8mb4_bin' AFTER `nick_name`;
UPDATE `sys_user` SET `user_type`="sys_user";
ALTER TABLE `sys_logininfor`
CHANGE COLUMN `info_id` `info_id` BIGINT(19) NOT NULL COMMENT '访ID' FIRST;
ALTER TABLE `sys_oper_log`
CHANGE COLUMN `oper_id` `oper_id` BIGINT(19) NOT NULL COMMENT '' FIRST;
insert into sys_dict_type values(11, '', 'sys_grant_type',1, sysdate(), 1, sysdate(), '');
insert into sys_dict_data values(30, 1, '', 'password', 'sys_grant_type', 'el-check-tag', 'default', 'N', 1, sysdate(), 1, sysdate(), '');
insert into sys_dict_data values(31, 2, '', 'sms', 'sys_grant_type', 'el-check-tag', 'default', 'N', 1, sysdate(), 1, sysdate(), '');
insert into sys_dict_data values(32, 3, '', 'email', 'sys_grant_type', 'el-check-tag', 'default', 'N', 1, sysdate(), 1, sysdate(), '');
insert into sys_dict_data values(33, 4, '', 'xcx', 'sys_grant_type', 'el-check-tag', 'default', 'N', 1, sysdate(), 1, sysdate(), '');
insert into sys_dict_data values(34, 5, '', 'social', 'sys_grant_type', 'el-check-tag', 'default', 'N', 1, sysdate(), 1, sysdate(), '');
CREATE TABLE `mf_student` (
`student_id` BIGINT(19) NOT NULL COMMENT '',
`student_name` VARCHAR(30) NULL DEFAULT '' COMMENT '' COLLATE 'utf8mb4_bin',
`student_age` INT(10) NULL DEFAULT NULL COMMENT '',
`student_hobby` VARCHAR(30) NULL DEFAULT '' COMMENT '0 1 2' COLLATE 'utf8mb4_bin',
`student_gender` CHAR(1) NULL DEFAULT '1' COMMENT '1 2 3' COLLATE 'utf8mb4_bin',
`student_status` CHAR(1) NULL DEFAULT '0' COMMENT '0 1' COLLATE 'utf8mb4_bin',
`student_birthday` DATETIME NULL DEFAULT NULL COMMENT '',
`create_by` BIGINT(19) NOT NULL DEFAULT '0' COMMENT '',
`create_time` DATETIME NULL DEFAULT NULL COMMENT '',
`update_by` BIGINT(19) NOT NULL DEFAULT '0' COMMENT '',
`update_time` DATETIME NULL DEFAULT NULL COMMENT '',
PRIMARY KEY (`student_id`) USING BTREE
)
COMMENT=''
COLLATE='utf8mb4_bin'
ENGINE=InnoDB
;
-- 菜单 SQL
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('', '2018', '1', 'student', 'mf/student/index', 1, 0, 'C', '0', '0', 'mf:student:list', '#', 1, sysdate(), 1, null, '');
-- 按钮父菜单ID
SELECT @parentId := LAST_INSERT_ID();
-- 按钮 SQL
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('', @parentId, '1', '#', '', 1, 0, 'F', '0', '0', 'mf:student:query', '#', 1, sysdate(), 1, null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('', @parentId, '2', '#', '', 1, 0, 'F', '0', '0', 'mf:student:add', '#', 1, sysdate(), 1, null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('', @parentId, '3', '#', '', 1, 0, 'F', '0', '0', 'mf:student:edit', '#', 1, sysdate(), 1, null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('', @parentId, '4', '#', '', 1, 0, 'F', '0', '0', 'mf:student:remove', '#', 1, sysdate(), 1, null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('', @parentId, '5', '#', '', 1, 0, 'F', '0', '0', 'mf:student:export', '#', 1, sysdate(), 1, null, '');
CREATE TABLE `mf_product` (
`product_id` BIGINT(19) NOT NULL COMMENT 'id',
`parent_id` BIGINT(19) NULL DEFAULT '0' COMMENT 'id',
`product_name` VARCHAR(30) NULL DEFAULT '' COMMENT '' COLLATE 'utf8mb4_bin',
`order_num` INT(10) NULL DEFAULT '0' COMMENT '',
`status` CHAR(1) NULL DEFAULT '0' COMMENT '0 1' COLLATE 'utf8mb4_bin',
`create_by` BIGINT(19) NOT NULL DEFAULT '0' COMMENT '',
`create_time` DATETIME NULL DEFAULT NULL COMMENT '',
`update_by` BIGINT(19) NOT NULL DEFAULT '0' COMMENT '',
`update_time` DATETIME NULL DEFAULT NULL COMMENT '',
PRIMARY KEY (`product_id`) USING BTREE
)
COMMENT=''
COLLATE='utf8mb4_bin'
ENGINE=InnoDB
;
-- 菜单 SQL
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('', '2018', '1', 'product', 'mf/product/index', 1, 0, 'C', '0', '0', 'mf:product:list', '#', 1, sysdate(), 1, null, '');
-- 按钮父菜单ID
SELECT @parentId := LAST_INSERT_ID();
-- 按钮 SQL
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('', @parentId, '1', '#', '', 1, 0, 'F', '0', '0', 'mf:product:query', '#', 1, sysdate(), 1, null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('', @parentId, '2', '#', '', 1, 0, 'F', '0', '0', 'mf:product:add', '#', 1, sysdate(), 1, null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('', @parentId, '3', '#', '', 1, 0, 'F', '0', '0', 'mf:product:edit', '#', 1, sysdate(), 1, null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('', @parentId, '4', '#', '', 1, 0, 'F', '0', '0', 'mf:product:remove', '#', 1, sysdate(), 1, null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('', @parentId, '5', '#', '', 1, 0, 'F', '0', '0', 'mf:product:export', '#', 1, sysdate(), 1, null, '');
-- 表 sys_oss 结构
CREATE TABLE IF NOT EXISTS `sys_oss` (
`oss_id` bigint NOT NULL COMMENT '',
`file_name` varchar(255) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '',
`original_name` varchar(255) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '',
`file_suffix` varchar(10) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '',
`url` varchar(500) COLLATE utf8mb4_bin NOT NULL COMMENT 'URL地址',
`service` varchar(20) COLLATE utf8mb4_bin NOT NULL DEFAULT 'minio' COMMENT '',
`create_by` bigint DEFAULT NULL COMMENT '',
`create_time` datetime DEFAULT NULL COMMENT '',
`update_by` bigint DEFAULT NULL COMMENT '',
`update_time` datetime DEFAULT NULL COMMENT '',
PRIMARY KEY (`oss_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='OSS对象存储表';
-- 表 sys_oss_config 结构
CREATE TABLE IF NOT EXISTS `sys_oss_config` (
`oss_config_id` bigint NOT NULL COMMENT '',
`config_key` varchar(20) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT 'key',
`access_key` varchar(255) COLLATE utf8mb4_bin DEFAULT '' COMMENT 'accessKey',
`secret_key` varchar(255) COLLATE utf8mb4_bin DEFAULT '' COMMENT '',
`bucket_name` varchar(255) COLLATE utf8mb4_bin DEFAULT '' COMMENT '',
`prefix` varchar(255) COLLATE utf8mb4_bin DEFAULT '' COMMENT '',
`endpoint` varchar(255) COLLATE utf8mb4_bin DEFAULT '' COMMENT '访',
`domain` varchar(255) COLLATE utf8mb4_bin DEFAULT '' COMMENT '',
`is_https` char(1) COLLATE utf8mb4_bin DEFAULT 'N' COMMENT 'httpsY=,N=',
`region` varchar(255) COLLATE utf8mb4_bin DEFAULT '' COMMENT '',
`access_policy` char(1) COLLATE utf8mb4_bin NOT NULL DEFAULT '1' COMMENT '(0=private 1=public 2=custom)',
`status` char(1) COLLATE utf8mb4_bin DEFAULT '1' COMMENT '0=,1=',
`ext1` varchar(255) COLLATE utf8mb4_bin DEFAULT '' COMMENT '',
`create_by` bigint DEFAULT NULL COMMENT '',
`create_time` datetime DEFAULT NULL COMMENT '',
`update_by` bigint DEFAULT NULL COMMENT '',
`update_time` datetime DEFAULT NULL COMMENT '',
`remark` varchar(500) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '',
PRIMARY KEY (`oss_config_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='';
-- 表sys_oss_config 的数据:~4 rows (大约)
INSERT INTO `sys_oss_config` (`oss_config_id`, `config_key`, `access_key`, `secret_key`, `bucket_name`, `prefix`, `endpoint`, `domain`, `is_https`, `region`, `access_policy`, `status`, `ext1`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES
(1, 'minio', 'ruoyi-flex', 'ruoyi-flex@369', 'ruoyi-flex', '', '127.0.0.1:9000', '', 'N', '', '1', '0', '', 1, '2023-11-30 11:54:13', 1, '2023-12-01 14:23:59', NULL),
(2, 'qiniu', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi-flex', '', 's3-cn-north-1.qiniucs.com', '', 'N', '', '1', '1', '', 1, '2023-11-30 11:54:13', 1, '2023-12-01 14:25:43', NULL),
(3, 'aliyun', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi-flex', '', 'oss-cn-beijing.aliyuncs.com', '', 'N', '', '1', '1', '', 1, '2023-11-30 11:54:13', 1, '2023-12-01 14:25:48', NULL),
(4, 'qcloud', 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX', 'ruoyi-flex', '', 'cos.ap-beijing.myqcloud.com', '', 'N', '', '1', '1', '', 1, '2023-11-30 11:54:13', 1, '2023-12-01 14:26:02', NULL);
-- oss菜单
insert into sys_menu values('118', '', '1', '10', 'oss', 'system/oss/index', '', 1, 0, 'C', '0', '0', 'system:oss:list', 'upload', 1, sysdate(), 1, sysdate(), '');
-- 修改avatar字段类型为bigint
UPDATE sys_user SET avatar=null WHERE user_id>=1;
ALTER TABLE `sys_user`
CHANGE COLUMN `avatar` `avatar` BIGINT NULL DEFAULT NULL COMMENT '' AFTER `gender`;
-- 表sys_config 的数据:
INSERT INTO `sys_config` (`config_id`, `config_name`, `config_key`, `config_value`, `config_type`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES
(20, 'OSS预览列表资源开关', 'sys.oss.previewListResource', 'true', 'Y', 1, '2023-09-30 21:55:15', 1, '2023-12-01 22:32:10', 'true:, false:');
CREATE TABLE `mf_customer` (
`customer_id` BIGINT(19) NOT NULL COMMENT 'id',
`customer_name` VARCHAR(30) NULL DEFAULT '' COMMENT '' COLLATE 'utf8mb4_bin',
`phonenumber` VARCHAR(11) NULL DEFAULT '' COMMENT '' COLLATE 'utf8mb4_bin',
`gender` CHAR(1) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_bin',
`birthday` DATETIME NULL DEFAULT NULL COMMENT '',
`remark` VARCHAR(500) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_bin',
`create_by` BIGINT(19) NOT NULL DEFAULT '0' COMMENT '',
`create_time` DATETIME NULL DEFAULT NULL COMMENT '',
`update_by` BIGINT(19) NOT NULL DEFAULT '0' COMMENT '',
`update_time` DATETIME NULL DEFAULT NULL COMMENT '',
PRIMARY KEY (`customer_id`) USING BTREE
)
COMMENT=''
COLLATE='utf8mb4_bin'
ENGINE=InnoDB
;
CREATE TABLE `mf_goods` (
`goods_id` BIGINT(19) NOT NULL COMMENT 'id',
`customer_id` BIGINT(19) NOT NULL COMMENT 'id',
`name` VARCHAR(30) NULL DEFAULT '' COMMENT '' COLLATE 'utf8mb4_bin',
`weight` INT(10) NULL DEFAULT NULL COMMENT '',
`price` DECIMAL(6,2) NULL DEFAULT NULL COMMENT '',
`date` DATETIME NULL DEFAULT NULL COMMENT '',
`type` CHAR(1) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_bin',
`create_by` BIGINT(19) NOT NULL DEFAULT '0' COMMENT '',
`create_time` DATETIME NULL DEFAULT NULL COMMENT '',
`update_by` BIGINT(19) NOT NULL DEFAULT '0' COMMENT '',
`update_time` DATETIME NULL DEFAULT NULL COMMENT '',
PRIMARY KEY (`goods_id`) USING BTREE
)
COMMENT=''
COLLATE='utf8mb4_bin'
ENGINE=InnoDB
;
-- 菜单 SQL
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('', '2018', '1', 'customer', 'mf/customer/index', 1, 0, 'C', '0', '0', 'mf:customer:list', '#', 1, sysdate(), 1, null, '');
-- 按钮父菜单ID
SELECT @parentId := LAST_INSERT_ID();
-- 按钮 SQL
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('', @parentId, '1', '#', '', 1, 0, 'F', '0', '0', 'mf:customer:query', '#', 1, sysdate(), 1, null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('', @parentId, '2', '#', '', 1, 0, 'F', '0', '0', 'mf:customer:add', '#', 1, sysdate(), 1, null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('', @parentId, '3', '#', '', 1, 0, 'F', '0', '0', 'mf:customer:edit', '#', 1, sysdate(), 1, null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('', @parentId, '4', '#', '', 1, 0, 'F', '0', '0', 'mf:customer:remove', '#', 1, sysdate(), 1, null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('', @parentId, '5', '#', '', 1, 0, 'F', '0', '0', 'mf:customer:export', '#', 1, sysdate(), 1, null, '');
--修正“演示模块”的“路由地址”重复的问题
update sys_menu set path="mfstudent" where component="mf/student/index";
update sys_menu set path="mfproduct" where component="mf/product/index";
update sys_menu set path="mfcustomer" where component="mf/customer/index";