Setting up project

This commit is contained in:
Damien Broqua 2018-09-07 21:14:05 +02:00
parent d07237cc6b
commit a8dc7f8323
23 changed files with 6055 additions and 0 deletions

View file

@ -0,0 +1,15 @@
module.exports = (sequelize, DataTypes) => {
const vegetablePictures = sequelize.define('vegetablePictures', {
url: DataTypes.STRING,
order: DataTypes.INTEGER,
vegetables_id: {
type: DataTypes.INTEGER,
references: 'vegetables',
referencesKey: 'id'
}
}, {})
vegetablePictures.associate = function (models) {
vegetablePictures.hasOne(models.vegetables, { as: 'Vegetables', foreignKey: 'vegetables_id' })
}
return vegetablePictures
}