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.
SOD/models/sandwich.js

26 lines
509 B
JavaScript

"use strict";
const {
Model
} = require("sequelize");
module.exports = (sequelize, DataTypes) => {
class Sandwich extends Model {
static associate(models) {
Sandwich.belongsToMany(models.Command, {through: "SandwichCommand"});
}
}
Sandwich.init({
name: {
type: DataTypes.STRING,
allowNull: false,
unique: true
},
price: {
type: DataTypes.FLOAT,
allowNull: false
}
}, {
sequelize,
modelName: "Sandwich",
});
return Sandwich;
};