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
});
RealEstate.associate = models => {
RealEstate.belongsToMany(models.SearchRequestMatch, {
through: "SearchRequestMatch"
});
};
return RealEstate;
};

View File

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

View File

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