sequelize-auto icon indicating copy to clipboard operation
sequelize-auto copied to clipboard

HasManyCreateAssociationMixin does not have primary key assigned

Open Bullfrog1234 opened this issue 9 months ago • 1 comments

When there is a many to many relationships it builds to the following:

 addAccountRoles!: Sequelize.HasManyAddAssociationsMixin<
    AccountRole,
    AccountRoleId
  >;
  createAccountRole!: Sequelize.HasManyCreateAssociationMixin<
    AccountRole
  >;
  removeAccountRole!: Sequelize.HasManyRemoveAssociationMixin<
    AccountRole,
    AccountRoleId
  >;

The mixin HasManyCreateAssociationMixin has a second property for the Foreign Key, this should be set to primary key. In most cases this should be the Primary Key of the table unless the foreign key name is something difference

Bullfrog1234 avatar Jan 13 '25 06:01 Bullfrog1234