Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

这个是什么原因呢? #41

Open
zhangsanplus opened this issue Dec 9, 2019 · 1 comment
Open

这个是什么原因呢? #41

zhangsanplus opened this issue Dec 9, 2019 · 1 comment

Comments

@zhangsanplus
Copy link

http://127.0.0.1:6060/article/list

{
stack: "SequelizeDatabaseError: Unknown column 'tags.articleId' in 'on clause' at Query.formatError (F:\github\react-blog\server\node_modules\sequelize\lib\dialects\mysql\query.js:244:16) at Query.handler [as onResult] (F:\github\react-blog\server\node_modules\sequelize\lib\dialects\mysql\query.js:51:23) at Query.execute (F:\github\react-blog\server\node_modules\mysql2\lib\commands\command.js:30:14) at Connection.handlePacket (F:\github\react-blog\server\node_modules\mysql2\lib\connection.js:408:32) at PacketParser.Connection.packetParser.p [as onPacket] (F:\github\react-blog\server\node_modules\mysql2\lib\connection.js:70:12) at PacketParser.executeStart (F:\github\react-blog\server\node_modules\mysql2\lib\packet_parser.js:75:16) at Socket.Connection.stream.on.data (F:\github\react-blog\server\node_modules\mysql2\lib\connection.js:77:25) at emitOne (events.js:115:13) at Socket.emit (events.js:210:7) at addChunk (_stream_readable.js:266:12) at readableAddChunk (_stream_readable.js:253:11) at Socket.Readable.push (_stream_readable.js:211:10) at TCP.onread (net.js:587:20) From previous event: at Query.run (F:\github\react-blog\server\node_modules\sequelize\lib\dialects\mysql\query.js:39:12) at runHooks.then.then (F:\github\react-blog\server\node_modules\sequelize\lib\sequelize.js:645:29) From previous event: at Promise.try.then.connection (F:\github\react-blog\server\node_modules\sequelize\lib\sequelize.js:645:12) From previous event: at Promise.resolve.retry (F:\github\react-blog\server\node_modules\sequelize\lib\sequelize.js:641:10) at F:\github\react-blog\server\node_modules\retry-as-promised\index.js:70:21 at Promise () at retryAsPromised (F:\github\react-blog\server\node_modules\retry-as-promised\index.js:60:10) at Promise.try (F:\github\react-blog\server\node_modules\sequelize\lib\sequelize.js:631:30) From previous event: at Sequelize.query (F:\github\react-blog\server\node_modules\sequelize\lib\sequelize.js:580:23) at QueryInterface.rawSelect (F:\github\react-blog\server\node_modules\sequelize\lib\query-interface.js:1163:27) at Function.aggregate (F:\github\react-blog\server\node_modules\sequelize\lib\model.js:1993:32) at Promise.try.then (F:\github\react-blog\server\node_modules\sequelize\lib\model.js:2045:19) at runCallback (timers.js:781:20) at tryOnImmediate (timers.js:743:5) at processImmediate [as _immediateCallback] (timers.js:714:5) From previous event: at Function.count (F:\github\react-blog\server\node_modules\sequelize\lib\model.js:2029:8) at Function.findAndCountAll (F:\github\react-blog\server\node_modules\sequelize\lib\model.js:2097:12) at getList (F:\github\react-blog\server\controllers\article.js:129:39) at dispatch (F:\github\react-blog\server\node_modules\koa-compose\index.js:44:32) at next (F:\github\react-blog\server\node_modules\koa-compose\index.js:45:18) at F:\github\react-blog\server\node_modules\koa-router\lib\router.js:346:16 at dispatch (F:\github\react-blog\server\node_modules\koa-compose\index.js:44:32) at F:\github\react-blog\server\node_modules\koa-compose\index.js:36:12 at dispatch (F:\github\react-blog\server\node_modules\koa-router\lib\router.js:351:31) at dispatch (F:\github\react-blog\server\node_modules\koa\node_modules\koa-compose\index.js:42:32) at logger (F:\github\react-blog\server\node_modules\koa-logger\index.js:67:13) at dispatch (F:\github\react-blog\server\node_modules\koa\node_modules\koa-compose\index.js:42:32) at module.exports (F:\github\react-blog\server\middlewares\authHandler.js:56:11) at dispatch (F:\github\react-blog\server\node_modules\koa\node_modules\koa-compose\index.js:42:32) at jsonError (F:\github\react-blog\server\node_modules\koa-json-error\lib\middleware.js:49:12) at dispatch (F:\github\react-blog\server\node_modules\koa\node_modules\koa-compose\index.js:42:32) at F:\github\react-blog\server\node_modules\koa-body\index.js:148:14 at at process._tickCallback (internal/process/next_tick.js:188:7)",
name: "SequelizeDatabaseError",
parent: {
code: "ER_BAD_FIELD_ERROR",
errno: 1054,
sqlState: "42S22",
sqlMessage: "Unknown column 'tags.articleId' in 'on clause'",
sql: "SELECT count(DISTINCT(article.id)) AS count FROM article AS article LEFT OUTER JOIN tag AS tags ON article.id = tags.articleId LEFT OUTER JOIN category AS categories ON article.id = categories.articleId LEFT OUTER JOIN comment AS comments ON article.id = comments.articleId LEFT OUTER JOIN reply AS comments->replies ON comments.id = comments->replies.commentId WHERE article.id != -1 AND (article.title LIKE '%%' OR article.content LIKE '%%');"
},
original: {
code: "ER_BAD_FIELD_ERROR",
errno: 1054,
sqlState: "42S22",
sqlMessage: "Unknown column 'tags.articleId' in 'on clause'",
sql: "SELECT count(DISTINCT(article.id)) AS count FROM article AS article LEFT OUTER JOIN tag AS tags ON article.id = tags.articleId LEFT OUTER JOIN category AS categories ON article.id = categories.articleId LEFT OUTER JOIN comment AS comments ON article.id = comments.articleId LEFT OUTER JOIN reply AS comments->replies ON comments.id = comments->replies.commentId WHERE article.id != -1 AND (article.title LIKE '%%' OR article.content LIKE '%%');"
},
sql: "SELECT count(DISTINCT(article.id)) AS count FROM article AS article LEFT OUTER JOIN tag AS tags ON article.id = tags.articleId LEFT OUTER JOIN category AS categories ON article.id = categories.articleId LEFT OUTER JOIN comment AS comments ON article.id = comments.articleId LEFT OUTER JOIN reply AS comments->replies ON comments.id = comments->replies.commentId WHERE article.id != -1 AND (article.title LIKE '%%' OR article.content LIKE '%%');",
message: "Unknown column 'tags.articleId' in 'on clause'",
status: 500
}

@alvin0216
Copy link
Owner

tag 表中不存在 articleId , 重新建一次表试一下!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants