DevLog

<Sequelize ์˜ค๋ฅ˜> Error: A column called 'id' was added to the attributes of 'Urls' but not marked with 'primaryKey: true' ๋ณธ๋ฌธ

๐Ÿ˜‚ Error-log

<Sequelize ์˜ค๋ฅ˜> Error: A column called 'id' was added to the attributes of 'Urls' but not marked with 'primaryKey: true'

Seungjae Lee 2021. 10. 18. 22:50

Sequelize๋Š” ํ…Œ์ด๋ธ”์„ ์ƒ์„ฑ ์‹œ, ์ž๋™์ ์œผ๋กœ id ์ปฌ๋Ÿผ ์ถ”๊ฐ€์™€ PrimaryKey ์„ค์ •์„ ํ•ด์ฃผ๋Š”๋ฐ,

์‚ฌ์šฉ์ž๊ฐ€ ํ…Œ์ด๋ธ”์„ ์ƒ์„ฑํ•  ๋•Œ ์ž„์˜๋กœ id ์ปฌ๋Ÿผ์„ ์ถ”๊ฐ€ํ–ˆ์„ ๊ฒฝ์šฐ ์œ„์˜ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•œ๋‹ค.

ํ•ด๊ฒฐ๋ฐฉ๋ฒ•์€, ํ…Œ์ด๋ธ”์„ ์ƒ์„ฑํ•  ๋•Œ id์ปฌ๋Ÿผ์„ ์ œ์™ธํ•œ ๋‚˜๋จธ์ง€ ์ปฌ๋Ÿผ๋งŒ ์ถ”๊ฐ€ํ•ด์ฃผ๋ฉด ๋œ๋‹ค.

+ (createdAt, updatedAt ์ปฌ๋Ÿผ๋„ ์ž๋™์œผ๋กœ ์ถ”๊ฐ€๋˜๋ฏ€๋กœ ์ถ”๊ฐ€ํ•  ํ•„์š” ์—†๋‹ค.)

Comments