add networks + random changes
This commit is contained in:
1 parent
bb36b2bd44
commit
5dc5a023b8
26 files changed
+1399
-1975
No files matched your search
@@ -0,0 +1,31 @@
|
||||
const { DataTypes } = require('sequelize');
|
||||
const sequelize = require('../config/database');
|
||||
|
||||
const EntryNetwork = sequelize.define('entryNetwork',
|
||||
{
|
||||
network_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
primaryKey: true,
|
||||
references: {
|
||||
model: 'Networks',
|
||||
key: 'id'
|
||||
}
|
||||
},
|
||||
entry_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
primaryKey: true,
|
||||
references: {
|
||||
model: 'Entries',
|
||||
key: 'id'
|
||||
}
|
||||
},
|
||||
order: {
|
||||
type: DataTypes.INTEGER
|
||||
}
|
||||
},
|
||||
{
|
||||
primaryKey: ['network_id', 'entry_id'],
|
||||
}
|
||||
);
|
||||
|
||||
module.exports = EntryNetwork;
|
||||
@@ -0,0 +1,18 @@
|
||||
const { DataTypes } = require('sequelize');
|
||||
const sequelize = require('../config/database');
|
||||
|
||||
const Network = sequelize.define("network",
|
||||
{
|
||||
id: { type: DataTypes.INTEGER, primaryKey: true },
|
||||
|
||||
name: { type: DataTypes.STRING(30) },
|
||||
originCountry: { type: DataTypes.STRING(100), field: 'origin_country' },
|
||||
homepage: { type: DataTypes.STRING(100), field: 'homepage' },
|
||||
|
||||
logoPath: { type: DataTypes.STRING(200), field: 'logo_path' },
|
||||
posterPath: { type: DataTypes.STRING(200), field: 'poster_path' },
|
||||
backdropPath: { type: DataTypes.STRING(200), field: 'backdrop_path' },
|
||||
}
|
||||
);
|
||||
|
||||
module.exports = Network;
|
||||
Reference in new issue
Block a user