belongs-to.ejs
297 Bytes
var User = sequelize.define('User', {/* ... */})
var Project = sequelize.define('Project', {/* ... */})
// One-way back associations
Project.belongsTo('initiator', User)
/*
In this example belongsTo will add an attribute UserId to the Project model!
That's the only difference to hasMany.
*/