I just got one question - how would you associate another model to the Note model?
Let's say we have a User model and we would like to implement Note.belongsTo(User).
I have made something like this but it keeps me getting an error like "note is not associated to user"
Hi Adnan,
Great work buddy!
I just got one question - how would you associate another model to the Note model?
Let's say we have a User model and we would like to implement Note.belongsTo(User).
I have made something like this but it keeps me getting an error like "note is not associated to user"
const User = require('./User');
module.exports = (sequelize, type) => {
const Note = sequelize.define('note', {
id: {
type: type.INTEGER,
primaryKey: true,
autoIncrement: true
},
title: type.STRING,
description: type.STRING
})
}
Hi @softnayr were you able to solve the "note is not associated to user" issue