Added rendering of Event Images
This commit is contained in:
@@ -41,6 +41,10 @@ module.exports = (sequelize) => {
|
||||
alsoOnHomepage: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false
|
||||
},
|
||||
relatedImage: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: true
|
||||
}
|
||||
}, {
|
||||
tableName: 'events',
|
||||
@@ -66,6 +70,10 @@ module.exports = (sequelize) => {
|
||||
otherKey: 'contact_person_id',
|
||||
as: 'contactPersons'
|
||||
});
|
||||
Event.belongsTo(models.Image, {
|
||||
foreignKey: 'relatedImage',
|
||||
as: 'relatedImageAssociation'
|
||||
})
|
||||
};
|
||||
|
||||
return Event;
|
||||
|
||||
Reference in New Issue
Block a user