MCPcopy
hub / github.com/sequelize/sequelize / belongsTo

Method belongsTo

lib/model.js:4535–4535  ·  lib/model.js::Model.belongsTo

* Creates an association between this (the source) and the provided target. The foreign key is added on the source. * * @param {Model} target The target model * @param {object} [options] belongsTo association options * @param {boolean} [options.hooks=false] Set

(target, options)

Source from the content-addressed store, hash-verified

4533 * Profile.belongsTo(User) class="cm">// This will add userId to the profile table
4534 */
4535 static belongsTo(target, options) {} class="cm">// eslint-disable-line
4536}
4537
4538Object.assign(Model, associationsMixin);

Callers 15

User.tsFile · 0.80
docs-example.tsFile · 0.80
ModelInit.tsFile · 0.80
model.test.jsFile · 0.80
sequelize.test.jsFile · 0.80
instance.test.jsFile · 0.80
json.test.jsFile · 0.80
include.test.jsFile · 0.80
createUsersAndItemsFunction · 0.80
executeTestFunction · 0.80
query.test.jsFile · 0.80

Calls

no outgoing calls

Tested by 2

createUsersAndItemsFunction · 0.64
executeTestFunction · 0.64