This is currently not possible in the future, but you can try this way.
The difference between HasOne and BelongsTo, HasOne inserts an association key into the target model, while BelongsTo inserts an association key into the original model. the association rather hasOne equals BelongsTo
TableB.belongsTo(models.TableA, { as: 'TableA', foreignKey: 'someID', targetKey: 'notTableAID' } );
thanh1101681
source share