Type alias HasManyAddAssociationsMixin<T, TModelPrimaryKey>

HasManyAddAssociationsMixin<T, TModelPrimaryKey>: ((newAssociations?: (T | TModelPrimaryKey)[], options?: HasManyAddAssociationsMixinOptions<T>) => Promise<void>)

Type Parameters

  • T extends Model

  • TModelPrimaryKey

Type declaration

    • (newAssociations?: (T | TModelPrimaryKey)[], options?: HasManyAddAssociationsMixinOptions<T>): Promise<void>
    • The addAssociations mixin applied to models with hasMany. An example of usage is as follows:

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

      User.hasMany(Role);

      See

      Model.hasMany

      Parameters

      Returns Promise<void>

Generated using TypeDoc