Added Properties to Vegetable

This commit is contained in:
Damien Broqua 2018-10-02 19:18:05 +02:00
parent c9652c1366
commit 6d94b5f60c
9 changed files with 277 additions and 1 deletions

View file

@ -21,6 +21,11 @@ module.exports = (sequelize, DataTypes) => {
foreignKey: 'vegetableId',
onDelete: 'cascade'
})
vegetables.hasMany(models.vegetableProperties, {
as: 'Properties',
foreignKey: 'vegetableId',
onDelete: 'cascade'
})
}
return vegetables
}