spee.ch/server/models/file.js

50 lines
900 B
JavaScript
Raw Permalink Normal View History

2017-06-22 08:33:03 +02:00
module.exports = (sequelize, { STRING, BOOLEAN, INTEGER }) => {
const File = sequelize.define(
'File',
{
name: {
type : STRING,
allowNull: false,
},
2017-06-20 00:25:14 +02:00
claimId: {
type : STRING,
allowNull: false,
},
2018-07-26 02:21:02 +02:00
outpoint: {
type : STRING,
allowNull: false,
},
2018-07-26 02:21:02 +02:00
fileHeight: {
type : INTEGER,
allowNull: false,
2018-07-26 02:21:02 +02:00
default : 0,
},
2018-07-26 02:21:02 +02:00
fileWidth: {
2017-06-22 08:33:03 +02:00
type : INTEGER,
allowNull: false,
default : 0,
},
2017-06-20 00:25:14 +02:00
fileName: {
type : STRING,
allowNull: false,
},
2017-06-20 00:25:14 +02:00
filePath: {
type : STRING,
allowNull: false,
},
2017-06-20 00:25:14 +02:00
fileType: {
type: STRING,
},
},
{
freezeTableName: true,
}
);
2017-07-13 00:30:31 +02:00
File.associate = db => {
2017-09-15 23:41:47 +02:00
File.hasOne(db.Claim);
2017-07-13 00:30:31 +02:00
};
return File;
};