Files
Showy/backend/models/UserCollectionEntry.js
T

30 lines
638 B
JavaScript

const { DataTypes } = require('sequelize');
const sequelize = require('../config/database');
const UserCollectionEntry = sequelize.define('userCollectionEntry',
{
user_collection_id: {
type: DataTypes.INTEGER,
primaryKey: true,
references: {
model: 'UserCollections',
key: 'id'
}
},
entry_id: {
type: DataTypes.INTEGER,
primaryKey: true,
references: {
model: 'Entries',
key: 'id'
}
},
order: {
type: DataTypes.INTEGER
}
},
{
primaryKey: ['user_collection_id', 'entry_id'],
});
module.exports = UserCollectionEntry;