add backend models/ add properties for some
This commit is contained in:
1 parent
3f28660a4d
commit
8a1d5a8416
9 files changed
+67
-4
No files matched your search
@@ -0,0 +1,29 @@
|
||||
const { DataTypes } = require('sequelize');
|
||||
const sequelize = require('../db/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;
|
||||
Reference in new issue
Block a user