created entry, entryid, entryRating, collection models
This commit is contained in:
1 parent
0670b4b65d
commit
772db77e98
4 files changed
+89
No files matched your search
@@ -0,0 +1,13 @@
|
|||||||
|
const { DataTypes } = require('sequelize');
|
||||||
|
const sequelize = require('../db/database');
|
||||||
|
|
||||||
|
const Collection = sequelize.define("collection",
|
||||||
|
{
|
||||||
|
id: { type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true },
|
||||||
|
title: { type: DataTypes.STRING(50) },
|
||||||
|
overview: { type: DataTypes.STRING(300) },
|
||||||
|
user_rating: { type: DataTypes.FLOAT }
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
module.exports = Collection;
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
const { DataTypes } = require('sequelize');
|
||||||
|
const sequelize = require('../db/database');
|
||||||
|
|
||||||
|
const Entry = sequelize.define("entry",
|
||||||
|
{
|
||||||
|
id: { type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true },
|
||||||
|
|
||||||
|
title: { type: DataTypes.STRING(50) },
|
||||||
|
original_title: { type: DataTypes.STRING(50) },
|
||||||
|
release_date: { type: DataTypes.DATE },
|
||||||
|
runtime: { type: DataTypes.INTEGER },
|
||||||
|
|
||||||
|
storyline: { type: DataTypes.STRING(500) },
|
||||||
|
country: { type: DataTypes.STRING(30) },
|
||||||
|
|
||||||
|
certification: { type: DataTypes.INTEGER },
|
||||||
|
network_studio: { type: DataTypes.STRING(40) },
|
||||||
|
collection_id: { type: DataTypes.INTEGER },
|
||||||
|
|
||||||
|
watchlist: { type: DataTypes.BOOLEAN, defaultValue: false },
|
||||||
|
favorit: { type: DataTypes.BOOLEAN, defaultValue: false },
|
||||||
|
hidden: { type: DataTypes.BOOLEAN, defaultValue: false },
|
||||||
|
|
||||||
|
is_tvseries: { type: DataTypes.BOOLEAN },
|
||||||
|
status: { type: DataTypes.STRING(20) },
|
||||||
|
|
||||||
|
poster_path: { type: DataTypes.STRING(50) },
|
||||||
|
|
||||||
|
date_first_seen: { type: DataTypes.DATEONLY },
|
||||||
|
date_last_seen: { type: DataTypes.DATEONLY }
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
module.exports = Entry;
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
const { DataTypes } = require('sequelize');
|
||||||
|
const sequelize = require('../db/database');
|
||||||
|
|
||||||
|
const EntryId = sequelize.define("entryId",
|
||||||
|
{
|
||||||
|
id: { type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true },
|
||||||
|
entry_id: {
|
||||||
|
type: DataTypes.INTEGER,
|
||||||
|
references: {
|
||||||
|
model: 'Entries',
|
||||||
|
key: 'id'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
tmdb_id: { type: DataTypes.STRING(15) },
|
||||||
|
imdb_id: { type: DataTypes.STRING(15) },
|
||||||
|
tvdb_id: { type: DataTypes.STRING(15) },
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
module.exports = EntryId;
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
const { DataTypes } = require('sequelize');
|
||||||
|
const sequelize = require('../db/database');
|
||||||
|
|
||||||
|
|
||||||
|
const EntryRating = sequelize.define("entryRating",
|
||||||
|
{
|
||||||
|
id: { type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true },
|
||||||
|
entry_id: {
|
||||||
|
type: DataTypes.INTEGER,
|
||||||
|
references: {
|
||||||
|
model: 'Entries',
|
||||||
|
key: 'id'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
user_rating: { type: DataTypes.FLOAT },
|
||||||
|
tmdb_rating: { type: DataTypes.FLOAT },
|
||||||
|
imdb_rating: { type: DataTypes.FLOAT },
|
||||||
|
rotten_tomatoes_rating: { type: DataTypes.FLOAT },
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
module.exports = EntryRating;
|
||||||
Reference in new issue
Block a user