Type alias HasManyCreateAssociationMixin<TModel, TForeignKey, TScope>

HasManyCreateAssociationMixin<TModel, TForeignKey, TScope>: ((values?: Omit<CreationAttributes<TModel>, TForeignKey | TScope>, options?: HasManyCreateAssociationMixinOptions<TModel>) => Promise<TModel>)

Type Parameters

Type declaration

    • (values?: Omit<CreationAttributes<TModel>, TForeignKey | TScope>, options?: HasManyCreateAssociationMixinOptions<TModel>): Promise<TModel>
    • The createAssociation mixin applied to models with hasMany. An example of usage is as follows:

      class User extends Model<InferAttributes<User>, InferCreationAttributes<User>> {
      declare createRole: HasManyCreateAssociationMixin<Role>;
      }

      User.hasMany(Role);

      See

      Model.hasMany

      Parameters

      Returns Promise<TModel>

Generated using TypeDoc