The setAssociation mixin applied to models with belongsTo. An example of usage is as follows:
class User extends Model<InferAttributes<User>, InferCreationAttributes<User>> { declare setRole: BelongsToSetAssociationMixin<Role, Role['id']>;}User.belongsTo(Role); Copy
class User extends Model<InferAttributes<User>, InferCreationAttributes<User>> { declare setRole: BelongsToSetAssociationMixin<Role, Role['id']>;}User.belongsTo(Role);
The type of the attribute that the foreign key references.
Optional
Model.belongsTo
The setAssociation mixin applied to models with belongsTo. An example of usage is as follows: