add search request association to the Search Request Match model

This commit is contained in:
Bilal Catic
2019-11-04 10:57:54 +01:00
parent 46dbe40891
commit b6bc67e442

View File

@@ -44,6 +44,12 @@ module.exports = (sequelize, DataTypes) => {
);
SearchRequestMatch.associate = models => {
SearchRequestMatch.hasMany(models.SearchRequest, {
foreignKey: "id",
sourceKey: "searchRequestId",
targetKey: "id",
as: "searchRequests"
});
SearchRequestMatch.hasMany(models.RealEstate, {
foreignKey: "id",
as: "realEstates"