Type alias HasManyAddAssociationMixin<T, TModelPrimaryKey>

HasManyAddAssociationMixin<T, TModelPrimaryKey>: ((newAssociation?: T | TModelPrimaryKey, options?: HasManyAddAssociationMixinOptions<T>) => Promise<void>)

Type Parameters

  • T extends Model

  • TModelPrimaryKey

Type declaration

    • (newAssociation?: T | TModelPrimaryKey, options?: HasManyAddAssociationMixinOptions<T>): Promise<void>
    • The addAssociation mixin applied to models with hasMany. An example of usage is as follows:

      class User extends Model<InferAttributes<User>, InferCreationAttributes<User>> {
      declare addRole: HasManyAddAssociationMixin<Role, Role['id']>;
      }

      User.hasMany(Role);

      See

      Model.hasMany

      Parameters

      Returns Promise<void>

Generated using TypeDoc