29 lines
580 B
JavaScript
29 lines
580 B
JavaScript
"use strict";
|
|
module.exports = (sequelize, DataTypes) => {
|
|
const Dish = sequelize.define('Dish', {
|
|
name: {
|
|
type: DataTypes.STRING,
|
|
allowNull: false,
|
|
unique: true
|
|
},
|
|
price: {
|
|
type: DataTypes.FLOAT,
|
|
defaultValue: 0,
|
|
allowNull: false
|
|
},
|
|
maxIngredients: {
|
|
type: DataTypes.INTEGER,
|
|
allowNull: false
|
|
},
|
|
maxSauces: {
|
|
type: DataTypes.INTEGER,
|
|
allowNull: false
|
|
}
|
|
}, {
|
|
tableName: "Dishes"
|
|
});
|
|
Dish.associate = function(models) {
|
|
Dish.hasMany(models.Command);
|
|
};
|
|
return Dish;
|
|
};
|