MCPcopy
hub / github.com/sequelize/sequelize / hasOne

Method hasOne

lib/model.js:4515–4515  ·  lib/model.js::Model.hasOne

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

(target, options)

Source from the content-addressed store, hash-verified

4513 * User.hasOne(Profile) class="cm">// This will add userId to the profile table
4514 */
4515 static hasOne(target, options) {} class="cm">// eslint-disable-line
4516
4517 /**
4518 * Creates an association between this (the source) and the provided target. The foreign key is added on the source.

Callers 15

model.tsFile · 0.80
sequelize.tsFile · 0.80
docs-example.tsFile · 0.80
ModelInit.tsFile · 0.80
instance.test.jsFile · 0.80
include.test.jsFile · 0.80
createUsersAndItemsFunction · 0.80
scope.test.jsFile · 0.80
has-one.test.jsFile · 0.80
belongs-to.test.jsFile · 0.80

Calls

no outgoing calls

Tested by 1

createUsersAndItemsFunction · 0.64