25 lines
711 B
JavaScript
25 lines
711 B
JavaScript
const { DataTypes } = require('sequelize');
|
|
const sequelize = require('../db/database');
|
|
|
|
const Media = sequelize.define("media",
|
|
{
|
|
id: { type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true },
|
|
|
|
entryId: {
|
|
type: DataTypes.INTEGER,
|
|
references: {
|
|
model: 'Entries',
|
|
key: 'id'
|
|
},
|
|
field: 'entry_id'
|
|
},
|
|
|
|
type: { type: DataTypes.STRING(50) },
|
|
path: { type: DataTypes.STRING(200) },
|
|
isLocal: { type: DataTypes.BOOLEAN, field: 'is_local' },
|
|
isSelected: { type: DataTypes.BOOLEAN, field: 'is_selected', defaultValue: false },
|
|
isCustom: { type: DataTypes.BOOLEAN, field: 'is_custom', defaultValue: false },
|
|
}
|
|
);
|
|
|
|
module.exports = Media; |