react-blog
react-blog copied to clipboard
这个是什么原因呢?
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 (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
}
tag 表中不存在 articleId , 重新建一次表试一下!