웹/Nodejs
2022. 11. 30.
✅ [NodeJs] sequelize에서 관계설정할 때 column 이름과 reference 이름을 달리해야 한다!
✅ sequelize에서 관계설정할 때 column 이름과 reference 이름을 달리해야 한다! 여기서 reference이름이란 xx as minho 처럼 별명지어 출력을 할 때 쓰입니다. I faced exactly this problem while play with Sequelize, It's happened because the column name and reference name are same 잘못된 구현 module.exports = (sequelize, DataTypes) => { const session = sequelize.define('session', { menteeId: DataTypes.INTEGER, }, {}); session.associate = (models) => {..