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/sauce.js
2020-05-29 12:09:40 +02:00

24 lines
511 B
JavaScript

"use strict";
module.exports = (sequelize, DataTypes) => {
const Sauce = sequelize.define('Sauce', {
name: {
type: DataTypes.STRING,
allowNull: false,
unique: true
},
price: {
type: DataTypes.FLOAT,
defaultValue: 0,
allowNull: false
}
}, {
tableName: "Sauces"
});
Sauce.associate = function(models) {
// associations can be defined here
Sauce.belongsToMany(models.Command, {
through: "CommandsSauces"
});
};
return Sauce;
};