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/service.js

46 lines
No EOL
1,000 B
JavaScript

'use strict';
module.exports = (sequelize, DataTypes) => {
const Service = sequelize.define('Service', {
date: {
type: DataTypes.DATEONLY,
defaultValue: DataTypes.NOW,
primaryKey: true
},
sandwich1Busy: {
type: DataTypes.BOOLEAN,
defaultValue: false,
allowNull: false
},
sandwich2Busy: {
type: DataTypes.BOOLEAN,
defaultValue: false,
allowNull: false
},
sandwich3Busy: {
type: DataTypes.BOOLEAN,
defaultValue: false,
allowNull: false
}
}, {
tableName: "Services"
});
Service.associate = function(models) {
// associations can be defined here
Service.hasOne(models.User, {
as: "sandwich1"
});
Service.hasOne(models.User, {
as: "sandwich2"
});
Service.hasOne(models.User, {
as: "sandwich3"
});
Service.hasOne(models.User, {
as: "commi1"
});
Service.hasOne(models.User, {
as: "commi2"
})
};
return Service;
};