spee.ch/models/request.js

38 lines
665 B
JavaScript
Raw Normal View History

module.exports = (sequelize, { STRING, BOOLEAN, TEXT }) => {
2017-07-13 00:30:31 +02:00
const Request = sequelize.define(
'Request',
{
action: {
type : STRING,
allowNull: false,
},
url: {
type : STRING,
allowNull: false,
},
ipAddress: {
type : STRING,
allowNull: true,
},
result: {
2017-06-28 07:04:15 +02:00
type : TEXT('long'),
2017-06-28 06:32:05 +02:00
allowNull: true,
default : null,
},
},
{
freezeTableName: true,
}
);
2017-07-13 00:30:31 +02:00
Request.associate = db => {
Request.belongsTo(db.File, {
foreignKey: {
allowNull: true,
},
});
};
return Request;
};