arterli / CmsWing

一款基于Egg.js(为企业级框架和应用而生)、Sequelize和GraphQL,功能强大的(PC端,手机端和微信公众平台)电子商务平台及CMS建站系统
http://www.cmswing.com
Other
1.35k stars 451 forks source link

添加/修改model报错 #61

Closed machao95 closed 1 year ago

machao95 commented 1 year ago

2023-03-16 16:55:34,849 INFO 17284 egg-sequelize Executed (default): SHOW INDEX FROM sys_models_associate FROM meng_da 2023-03-16 16:55:34,863 INFO 12492 [egg-sequelize] Not overriding built-in method from model attribute: where 2023-03-16 16:55:34,866 INFO 12492 [egg-sequelize] Not overriding built-in method from model attribute: where 2023-03-16 16:55:34,867 INFO 12492 [egg-sequelize] Not overriding built-in method from model attribute: where 2023-03-16 16:55:34,869 ERROR 12492 nodejs.TypeError: Cannot read properties of undefined (reading 'hasMany') at Function.SysUser.associate (F:\workspace\mine\mengda-official-site\app\model\sys_user.js:22:31) at F:\workspace\mine\mengda-official-site\node_modules\egg-sequelize\lib\loader.js:118:54 at Array.forEach () at loadDatabase (F:\workspace\mine\mengda-official-site\node_modules\egg-sequelize\lib\loader.js:117:12) at F:\workspace\mine\mengda-official-site\node_modules\egg-sequelize\lib\loader.js:35:22 at Array.forEach () at module.exports (F:\workspace\mine\mengda-official-site\node_modules\egg-sequelize\lib\loader.js:34:24) at module.exports (F:\workspace\mine\mengda-official-site\node_modules\egg-sequelize\app.js:4:26) at Hook.configDidLoad (F:\workspace\mine\mengda-official-site\node_modules\egg-core\lib\lifecycle.js:99:9) at Lifecycle.triggerConfigDidLoad (F:\workspace\mine\mengda-official-site\node_modules\egg-core\lib\lifecycle.js:154:14)

pid: 12492 hostname: DESKTOP-559IHRU

F:\workspace\mine\mengda-official-site\node_modules\egg-cluster\lib\app_worker.js:32 throw err; ^

TypeError: Cannot read properties of undefined (reading 'hasMany') at Function.SysUser.associate (F:\workspace\mine\mengda-official-site\app\model\sys_user.js:22:31) at F:\workspace\mine\mengda-official-site\node_modules\egg-sequelize\lib\loader.js:118:54 at Array.forEach () at loadDatabase (F:\workspace\mine\mengda-official-site\node_modules\egg-sequelize\lib\loader.js:117:12) at F:\workspace\mine\mengda-official-site\node_modules\egg-sequelize\lib\loader.js:35:22 at Array.forEach () at module.exports (F:\workspace\mine\mengda-official-site\node_modules\egg-sequelize\lib\loader.js:34:24) at module.exports (F:\workspace\mine\mengda-official-site\node_modules\egg-sequelize\app.js:4:26) at Hook.configDidLoad (F:\workspace\mine\mengda-official-site\node_modules\egg-core\lib\lifecycle.js:99:9) at Lifecycle.triggerConfigDidLoad (F:\workspace\mine\mengda-official-site\node_modules\egg-core\lib\lifecycle.js:154:14) [2023-03-16 16:55:34.877] [cfork:master:15552] worker:12492 disconnect (exitedAfterDisconnect: false, state: disconnected, isDead: false, worker.disableRefork: true) [2023-03-16 16:55:34.877] [cfork:master:15552] don't fork, because worker:12492 will be kill soon 2023-03-16 16:55:34,878 INFO 15552 [master] app_worker#3:12492 disconnect, suicide: false, state: disconnected, current workers: ["2","3"] 2023-03-16 16:55:34,881 INFO 17284 egg-sequelize Executed (default): SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_NAME = 'sys_models_fields' AND TABLE_SCHEMA = 'meng_da' [2023-03-16 16:55:34.895] [cfork:master:15552] worker:12492 exit (code: 1, exitedAfterDisconnect: false, state: dead, isDead: true, isExpected: false, worker.disableRefork: true) [2023-03-16 16:55:34.896] [cfork:master:15552] worker:17284 disconnect (exitedAfterDisconnect: true, state: disconnected, isDead: false, worker.disableRefork: false) [2023-03-16 16:55:34.897] [cfork:master:15552] don't fork new work (refork: false) 2023-03-16 16:55:34,897 INFO 15552 [master] app_worker#2:17284 disconnect, suicide: true, state: disconnected, current workers: ["4"] 9233 closed 2023-03-16 16:55:34,906 WARN 6356 [ClusterClient:Connection] socket is closed by other side while there were still unhandled data in the socket buffer Debugger listening on ws://127.0.0.1:9233/a1e69dcb-56d5-448f-adb6-d44326a89222 For help, see: https://nodejs.org/en/docs/inspector [2023-03-16 16:55:34.927] [cfork:master:15552] worker:17284 exit (code: null, exitedAfterDisconnect: true, state: dead, isDead: true, isExpected: true, worker.disableRefork: false) 2023-03-16 16:55:35,816 INFO 9832 [RemoteConfig] loading remote config from F:\workspace\mine\mengda-official-site\run\remote_config.json 9233 opened