33 lines
575 B
JavaScript
33 lines
575 B
JavaScript
const { DataTypes } = require("sequelize");
|
|
const sequelize = require("../config/database");
|
|
|
|
const EntryGenre = sequelize.define(
|
|
"entryGenre",
|
|
{
|
|
genre_id: {
|
|
type: DataTypes.INTEGER,
|
|
primaryKey: true,
|
|
references: {
|
|
model: "Genres",
|
|
key: "id",
|
|
},
|
|
},
|
|
entry_id: {
|
|
type: DataTypes.INTEGER,
|
|
primaryKey: true,
|
|
references: {
|
|
model: "Entries",
|
|
key: "id",
|
|
},
|
|
},
|
|
},
|
|
{
|
|
primaryKey: ["genre_id", "entry_id"],
|
|
},
|
|
{
|
|
timestamps: false,
|
|
},
|
|
);
|
|
|
|
module.exports = EntryGenre;
|