Skip to content

Commit 8bf95a8

Browse files
author
Guillaume Gautreau
committed
chore: merge remote-tracking branch 'origin/master' into chore/merge-master-beta-11
2 parents 17eab99 + 6f06512 commit 8bf95a8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/adapters/sequelize.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ module.exports = (model, opts) => {
8787
const pkIsFk = primaryKeyIsForeignKey(association);
8888
if (pkIsFk) {
8989
const fk = fields.find((field) => field.reference === `${association.associationAccessor}.${association.foreignKey}`);
90-
fk.foreignAndPrimaryKey = true;
90+
if (fk) {
91+
fk.foreignAndPrimaryKey = true;
92+
}
9193
}
9294
});
9395

0 commit comments

Comments
 (0)