不要怂,就是干,撸起袖子干!

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.
*/