773579084 / leno-admin Goto Github PK
View Code? Open in Web Editor NEW以 React 18+nodejs(Koa) 技术栈实现完整的前后端分离项目
License: MIT License
以 React 18+nodejs(Koa) 技术栈实现完整的前后端分离项目
License: MIT License
监控机器cpu等信息是如何做的?同服务做 那服务打满的时候也记录不了cpu了
如题,可以对数据表的结构进行更新,使用sequelize自带的功能,自动维护更新创建时间,更新时间和删除标记
// sequelize create
define: {
...,
charset: 'utf8',
paranoid: true,
},
在需要物理删除的时候,在sql中使用
Model.destroy({
where: {
...,
},
force: true
})
另外现在的增删改是没有事务操作的,不知道是不是遗漏了
有微信群吗 想加群交流
@773579084 /leno-admin/backend
项目中 sys_menu.order_num
的类型错误:
Executing (default): CREATE TABLE IF NOT EXISTS `sys_menu` (`menu_id` BIGINT NOT NULL auto_increment UNIQUE COMMENT '菜单ID', `menu_name` VARCHAR(255) NOT NULL COMMENT '菜单名称', `parent_id` BIGINT DEFAULT 0 COMMENT '父菜单ID', `order_num` INET DEFAULT 0 COMMENT '显示顺序', `path` CHAR(255) DEFAULT '' COMMENT '路由地址', `component` CHAR(255) COMMENT '组件路径', `query` CHAR(255) COMMENT '路由参数', `is_frame` CHAR(1) DEFAULT '1' COMMENT '是否为外链(0是 1否)', `is_cache` CHAR(1) DEFAULT '0' COMMENT '是否缓存(0缓存 1不缓存)', `menu_type` CHAR(1) DEFAULT '' COMMENT '菜单类型(M目录 C菜单 F按钮)', `visible` CHAR(1) DEFAULT '0' COMMENT '菜单状态(0显示 1隐藏)', `status` CHAR(1) DEFAULT '0' COMMENT '菜单状态(0正常 1停用)', `perms` CHAR(100) DEFAULT NULL COMMENT '权限标识', `icon` CHAR(100) DEFAULT '' COMMENT '菜单图标', `create_by` CHAR(64) DEFAULT '' COMMENT '创建者', `update_by` CHAR(64) DEFAULT '' COMMENT '更新者', `remark` CHAR(255) COMMENT '备注', `created_at` DATETIME NOT NULL, `updated_at` DATETIME NOT NULL, PRIMARY KEY (`menu_id`)) ENGINE=InnoDB COMMENT '菜单权限表';
数据库连接失败 Error:
at Query.run (/Users/liudaodan/Documents/proj/leno-admin/backend/node_modules/sequelize/src/dialects/mysql/query.js:46:25)
at /Users/liudaodan/Documents/proj/leno-admin/backend/node_modules/sequelize/src/sequelize.js:650:28
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at MySQLQueryInterface.createTable (/Users/liudaodan/Documents/proj/leno-admin/backend/node_modules/sequelize/src/dialects/abstract/query-interface.js:229:12)
at Function.sync (/Users/liudaodan/Documents/proj/leno-admin/backend/node_modules/sequelize/src/model.js:1353:7)
at Sequelize.sync (/Users/liudaodan/Documents/proj/leno-admin/backend/node_modules/sequelize/src/sequelize.js:825:9) {
name: 'SequelizeDatabaseError',
parent: Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INET DEFAULT 0 COMMENT '显示顺序', `path` CHAR(255) DEFAULT '' COMMENT '路ç' at line 1
at Packet.asError (/Users/liudaodan/Documents/proj/leno-admin/backend/node_modules/mysql2/lib/packets/packet.js:728:17)
at Query.execute (/Users/liudaodan/Documents/proj/leno-admin/backend/node_modules/mysql2/lib/commands/command.js:29:26)
at Connection.handlePacket (/Users/liudaodan/Documents/proj/leno-admin/backend/node_modules/mysql2/lib/connection.js:456:32)
at PacketParser.onPacket (/Users/liudaodan/Documents/proj/leno-admin/backend/node_modules/mysql2/lib/connection.js:85:12)
at PacketParser.executeStart (/Users/liudaodan/Documents/proj/leno-admin/backend/node_modules/mysql2/lib/packet_parser.js:75:16)
at Socket.<anonymous> (/Users/liudaodan/Documents/proj/leno-admin/backend/node_modules/mysql2/lib/connection.js:92:25)
at Socket.emit (node:events:513:28)
at addChunk (node:internal/streams/readable:315:12)
at readableAddChunk (node:internal/streams/readable:289:9)
at Socket.Readable.push (node:internal/streams/readable:228:10)
at TCP.onStreamRead (node:internal/stream_base_commons:190:23) {
code: 'ER_PARSE_ERROR',
errno: 1064,
sqlState: '42000',
sqlMessage: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INET DEFAULT 0 COMMENT '显示顺序', `path` CHAR(255) DEFAULT '' COMMENT '路ç' at line 1",
sql: "CREATE TABLE IF NOT EXISTS `sys_menu` (`menu_id` BIGINT NOT NULL auto_increment UNIQUE COMMENT '菜单ID', `menu_name` VARCHAR(255) NOT NULL COMMENT '菜单名称', `parent_id` BIGINT DEFAULT 0 COMMENT '父菜单ID', `order_num` INET DEFAULT 0 COMMENT '显示顺序', `path` CHAR(255) DEFAULT '' COMMENT '路由地址', `component` CHAR(255) COMMENT '组件路径', `query` CHAR(255) COMMENT '路由参数', `is_frame` CHAR(1) DEFAULT '1' COMMENT '是否为外链(0是 1否)', `is_cache` CHAR(1) DEFAULT '0' COMMENT '是否缓存(0缓存 1不缓存)', `menu_type` CHAR(1) DEFAULT '' COMMENT '菜单类型(M目录 C菜单 F按钮)', `visible` CHAR(1) DEFAULT '0' COMMENT '菜单状态(0显示 1隐藏)', `status` CHAR(1) DEFAULT '0' COMMENT '菜单状态(0正常 1停用)', `perms` CHAR(100) DEFAULT NULL COMMENT '权限标识', `icon` CHAR(100) DEFAULT '' COMMENT '菜单图标', `create_by` CHAR(64) DEFAULT '' COMMENT '创建者', `update_by` CHAR(64) DEFAULT '' COMMENT '更新者', `remark` CHAR(255) COMMENT '备注', `created_at` DATETIME NOT NULL, `updated_at` DATETIME NOT NULL, PRIMARY KEY (`menu_id`)) ENGINE=InnoDB COMMENT '菜单权限表';",
parameters: undefined
},
original: Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INET DEFAULT 0 COMMENT '显示顺序', `path` CHAR(255) DEFAULT '' COMMENT '路ç' at line 1
at Packet.asError (/Users/liudaodan/Documents/proj/leno-admin/backend/node_modules/mysql2/lib/packets/packet.js:728:17)
at Query.execute (/Users/liudaodan/Documents/proj/leno-admin/backend/node_modules/mysql2/lib/commands/command.js:29:26)
at Connection.handlePacket (/Users/liudaodan/Documents/proj/leno-admin/backend/node_modules/mysql2/lib/connection.js:456:32)
at PacketParser.onPacket (/Users/liudaodan/Documents/proj/leno-admin/backend/node_modules/mysql2/lib/connection.js:85:12)
at PacketParser.executeStart (/Users/liudaodan/Documents/proj/leno-admin/backend/node_modules/mysql2/lib/packet_parser.js:75:16)
at Socket.<anonymous> (/Users/liudaodan/Documents/proj/leno-admin/backend/node_modules/mysql2/lib/connection.js:92:25)
at Socket.emit (node:events:513:28)
at addChunk (node:internal/streams/readable:315:12)
at readableAddChunk (node:internal/streams/readable:289:9)
at Socket.Readable.push (node:internal/streams/readable:228:10)
at TCP.onStreamRead (node:internal/stream_base_commons:190:23) {
code: 'ER_PARSE_ERROR',
errno: 1064,
sqlState: '42000',
sqlMessage: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INET DEFAULT 0 COMMENT '显示顺序', `path` CHAR(255) DEFAULT '' COMMENT '路ç' at line 1",
sql: "CREATE TABLE IF NOT EXISTS `sys_menu` (`menu_id` BIGINT NOT NULL auto_increment UNIQUE COMMENT '菜单ID', `menu_name` VARCHAR(255) NOT NULL COMMENT '菜单名称', `parent_id` BIGINT DEFAULT 0 COMMENT '父菜单ID', `order_num` INET DEFAULT 0 COMMENT '显示顺序', `path` CHAR(255) DEFAULT '' COMMENT '路由地址', `component` CHAR(255) COMMENT '组件路径', `query` CHAR(255) COMMENT '路由参数', `is_frame` CHAR(1) DEFAULT '1' COMMENT '是否为外链(0是 1否)', `is_cache` CHAR(1) DEFAULT '0' COMMENT '是否缓存(0缓存 1不缓存)', `menu_type` CHAR(1) DEFAULT '' COMMENT '菜单类型(M目录 C菜单 F按钮)', `visible` CHAR(1) DEFAULT '0' COMMENT '菜单状态(0显示 1隐藏)', `status` CHAR(1) DEFAULT '0' COMMENT '菜单状态(0正常 1停用)', `perms` CHAR(100) DEFAULT NULL COMMENT '权限标识', `icon` CHAR(100) DEFAULT '' COMMENT '菜单图标', `create_by` CHAR(64) DEFAULT '' COMMENT '创建者', `update_by` CHAR(64) DEFAULT '' COMMENT '更新者', `remark` CHAR(255) COMMENT '备注', `created_at` DATETIME NOT NULL, `updated_at` DATETIME NOT NULL, PRIMARY KEY (`menu_id`)) ENGINE=InnoDB COMMENT '菜单权限表';",
parameters: undefined
},
sql: "CREATE TABLE IF NOT EXISTS `sys_menu` (`menu_id` BIGINT NOT NULL auto_increment UNIQUE COMMENT '菜单ID', `menu_name` VARCHAR(255) NOT NULL COMMENT '菜单名称', `parent_id` BIGINT DEFAULT 0 COMMENT '父菜单ID', `order_num` INET DEFAULT 0 COMMENT '显示顺序', `path` CHAR(255) DEFAULT '' COMMENT '路由地址', `component` CHAR(255) COMMENT '组件路径', `query` CHAR(255) COMMENT '路由参数', `is_frame` CHAR(1) DEFAULT '1' COMMENT '是否为外链(0是 1否)', `is_cache` CHAR(1) DEFAULT '0' COMMENT '是否缓存(0缓存 1不缓存)', `menu_type` CHAR(1) DEFAULT '' COMMENT '菜单类型(M目录 C菜单 F按钮)', `visible` CHAR(1) DEFAULT '0' COMMENT '菜单状态(0显示 1隐藏)', `status` CHAR(1) DEFAULT '0' COMMENT '菜单状态(0正常 1停用)', `perms` CHAR(100) DEFAULT NULL COMMENT '权限标识', `icon` CHAR(100) DEFAULT '' COMMENT '菜单图标', `create_by` CHAR(64) DEFAULT '' COMMENT '创建者', `update_by` CHAR(64) DEFAULT '' COMMENT '更新者', `remark` CHAR(255) COMMENT '备注', `created_at` DATETIME NOT NULL, `updated_at` DATETIME NOT NULL, PRIMARY KEY (`menu_id`)) ENGINE=InnoDB COMMENT '菜单权限表';",
parameters: {}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.