Archived
1
0
Fork 0
This repository has been archived on 2024-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
kfet/models/dish.js

30 lines
580 B
JavaScript
Raw Normal View History

2020-05-29 11:59:25 +02:00
"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,
2020-05-29 11:59:25 +02:00
allowNull: false
},
maxSauces: {
type: DataTypes.INTEGER,
2020-05-29 11:59:25 +02:00
allowNull: false
}
}, {
2020-05-29 19:44:12 +02:00
tableName: "Dishes"
2020-05-29 11:59:25 +02:00
});
Dish.associate = function(models) {
Dish.hasMany(models.Command);
};
return Dish;
};