Dears I have model order has association with OrderHasWarranty model
So OrderHasWarranty has 2 foreign key, I need Sequelize to check the include for both these foreign key (without using where condition)
so I used below associations in order model
Order.hasOne(models.OrderHasWarranty,{foreignKey:"orderId"});
Order.hasOne(models.OrderHasWarranty,{foreignKey:"warrantyFromOrderId"});
the raw query giving me :
LEFT OUTER JOIN `order_has_warranties` AS `OrderHasWarranty`
ON `Order`.`id` = `OrderHasWarranty`.`warrantyFromOrderId`
WHERE `Order`.`id` = '25459';
basically what i need is to convert the below query using association
LEFT OUTER JOIN `order_has_warranties`
AS `OrderHasWarranty` ON `Order`.`id` = `OrderHasWarranty`.`warrantyFromOrderId`
OR `Order`.`id` = `OrderHasWarranty`.`orderId` WHERE `Order`.`id` = '25459';
SO I need to use OR condition in associations, I tried using hasMany but no luck
thank you