Notification service #35

Merged
bilal.catic merged 26 commits from notification-service into master 2019-09-30 16:23:40 +02:00
3 changed files with 15 additions and 21 deletions
Showing only changes of commit b703d55c06 - Show all commits

View File

@@ -51,11 +51,5 @@ module.exports = (sequelize, DataTypes) => {
renewedDate: DataTypes.DATE renewedDate: DataTypes.DATE
}); });
RealEstate.associate = models => {
RealEstate.belongsToMany(models.SearchRequestMatch, {
through: "SearchRequestMatch"
});
};
return RealEstate; return RealEstate;
}; };

View File

@@ -64,11 +64,5 @@ module.exports = (sequelize, DataTypes) => {
} }
}); });
SearchRequest.associate = models => {
SearchRequest.belongsToMany(models.SearchRequestMatch, {
through: "SearchRequestMatch"
});
};
return SearchRequest; return SearchRequest;
}; };

View File

@@ -9,15 +9,6 @@ module.exports = (sequelize, DataTypes) => {
autoIncrement: true, autoIncrement: true,
allowNull: false allowNull: false
}, },
searchRequestId: {
type: DataTypes.UUID,
allowNull: false,
primaryKey: true,
references: {
model: "SearchRequest",
key: "id"
}
},
realEstateId: { realEstateId: {
type: DataTypes.BIGINT, type: DataTypes.BIGINT,
allowNull: false, allowNull: false,
@@ -29,6 +20,15 @@ module.exports = (sequelize, DataTypes) => {
onUpdate: "CASCADE", onUpdate: "CASCADE",
onDelete: "SET NULL" onDelete: "SET NULL"
}, },
searchRequestId: {
type: DataTypes.UUID,
allowNull: false,
primaryKey: true,
references: {
model: "SearchRequest",
key: "id"
}
},
notified: { notified: {
type: DataTypes.BOOLEAN, type: DataTypes.BOOLEAN,
allowNull: false, allowNull: false,
@@ -43,5 +43,11 @@ module.exports = (sequelize, DataTypes) => {
} }
); );
SearchRequestMatch.associate = models => {
SearchRequestMatch.hasMany(models.RealEstate, {
foreignKey: "id"
});
};
return SearchRequestMatch; return SearchRequestMatch;
}; };