작성
·
219
0
테이블 지웠다가 다시 해 보기도 하고
깃헙 보고 리트윗 관련한 코드를 다 비교해 봤는데 답을 못 찾고 있네요..
where 문 들어간 부분을 확인 해도 오타같은 별 다른 문제점을 못 찾았어요
아래 오류메시지는 터미널, 콘솔, 네트워크 탭 오류메시지 이구요, 어느 지점에서 문제가 생긴건지 방향좀 잡아주실수 있을까요.
original: Error: Unknown column 'Post.Retweet' in 'where clause'
at Packet.asError (C:\Users\user\Desktop\Project\NodeBird\ch1\back\node_modules\mysql2\lib\packets\packet.js:712:17)
at Query.execute (C:\Users\user\Desktop\Project\NodeBird\ch1\back\node_modules\mysql2\lib\commands\command.js:28:26)
at Connection.handlePacket (C:\Users\user\Desktop\Project\NodeBird\ch1\back\node_modules\mysql2\lib\connection.js:417:32)
at PacketParser.onPacket (C:\Users\user\Desktop\Project\NodeBird\ch1\back\node_modules\mysql2\lib\connection.js:75:12)
at PacketParser.executeStart (C:\Users\user\Desktop\Project\NodeBird\ch1\back\node_modules\mysql2\lib\packet_parser.js:75:16)
at Socket.<anonymous> (C:\Users\user\Desktop\Project\NodeBird\ch1\back\node_modules\mysql2\lib\connection.js:82:25)
at Socket.emit (events.js:210:5)
at addChunk (_stream_readable.js:309:12)
at readableAddChunk (_stream_readable.js:290:11)
at Socket.Readable.push (_stream_readable.js:224:10)
at TCP.onStreamRead (internal/stream_base_commons.js:182:23) {
code: 'ER_BAD_FIELD_ERROR',
errno: 1054,
sqlState: '42S22',
sqlMessage: "Unknown column 'Post.Retweet' in 'where clause'",
sql: 'SELECT `id`, `content`, `createdAt`, `updatedAt`, `UserId`, `RetweetId` FROM `Posts` AS `Post` WHERE `Post`.`UserId` = 2 AND `Post`.`Retweet` = 1 LIMIT 1;',
parameters: undefined
},
sql: 'SELECT `id`, `content`, `createdAt`, `updatedAt`, `UserId`, `RetweetId` FROM `Posts` AS `Post` WHERE `Post`.`UserId` = 2 AND `Post`.`Retweet` = 1 LIMIT 1;',
parameters: undefined
}
SequelizeDatabaseError: Unknown column 'Post.Retweet' in 'where clause'
at Query.formatError (C:\Users\user\Desktop\Project\NodeBird\ch1\back\node_modules\sequelize\lib\dialects\mysql\query.js:244:16)
at Query.handler [as onResult] (C:\Users\user\Desktop\Project\NodeBird\ch1\back\node_modules\sequelize\lib\dialects\mysql\query.js:51:23)
at Query.execute (C:\Users\user\Desktop\Project\NodeBird\ch1\back\node_modules\mysql2\lib\commands\command.js:30:14)
at Connection.handlePacket (C:\Users\user\Desktop\Project\NodeBird\ch1\back\node_modules\mysql2\lib\connection.js:417:32)
at PacketParser.onPacket (C:\Users\user\Desktop\Project\NodeBird\ch1\back\node_modules\mysql2\lib\connection.js:75:12)
at PacketParser.executeStart (C:\Users\user\Desktop\Project\NodeBird\ch1\back\node_modules\mysql2\lib\packet_parser.js:75:16)
at Socket.<anonymous> (C:\Users\user\Desktop\Project\NodeBird\ch1\back\node_modules\mysql2\lib\connection.js:82:25)
at Socket.emit (events.js:210:5)
at addChunk (_stream_readable.js:309:12)
at readableAddChunk (_stream_readable.js:290:11)
at Socket.Readable.push (_stream_readable.js:224:10)
at TCP.onStreamRead (internal/stream_base_commons.js:182:23)
POST /post/1/retweet 500 27.467 ms - 1528