add backend models/ add properties for some
This commit is contained in:
1 parent
3f28660a4d
commit
8a1d5a8416
9 files changed
+63
No files matched your search
@@ -10,6 +10,7 @@ const Entry = sequelize.define("entry",
|
|||||||
release_date: { type: DataTypes.DATE },
|
release_date: { type: DataTypes.DATE },
|
||||||
runtime: { type: DataTypes.INTEGER },
|
runtime: { type: DataTypes.INTEGER },
|
||||||
|
|
||||||
|
tagline: { type: DataTypes.STRING(100) },
|
||||||
storyline: { type: DataTypes.STRING(1000) },
|
storyline: { type: DataTypes.STRING(1000) },
|
||||||
country: { type: DataTypes.STRING(30) },
|
country: { type: DataTypes.STRING(30) },
|
||||||
|
|
||||||
@@ -25,6 +26,7 @@ const Entry = sequelize.define("entry",
|
|||||||
status: { type: DataTypes.STRING(20) },
|
status: { type: DataTypes.STRING(20) },
|
||||||
|
|
||||||
poster_path: { type: DataTypes.STRING(60) },
|
poster_path: { type: DataTypes.STRING(60) },
|
||||||
|
banner_path: { type: DataTypes.STRING(60) },
|
||||||
|
|
||||||
date_first_seen: { type: DataTypes.DATEONLY },
|
date_first_seen: { type: DataTypes.DATEONLY },
|
||||||
date_last_seen: { type: DataTypes.DATEONLY }
|
date_last_seen: { type: DataTypes.DATEONLY }
|
||||||
|
|||||||
@@ -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;
|
||||||
@@ -14,6 +14,8 @@ const EntryId = sequelize.define("entryId",
|
|||||||
tmdb_id: { type: DataTypes.STRING(30) },
|
tmdb_id: { type: DataTypes.STRING(30) },
|
||||||
imdb_id: { type: DataTypes.STRING(30) },
|
imdb_id: { type: DataTypes.STRING(30) },
|
||||||
tvdb_id: { type: DataTypes.STRING(30) },
|
tvdb_id: { type: DataTypes.STRING(30) },
|
||||||
|
}, {
|
||||||
|
timestamps: false,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ const EntryRating = sequelize.define("entryRating",
|
|||||||
tmdb_rating: { type: DataTypes.FLOAT },
|
tmdb_rating: { type: DataTypes.FLOAT },
|
||||||
imdb_rating: { type: DataTypes.FLOAT },
|
imdb_rating: { type: DataTypes.FLOAT },
|
||||||
rotten_tomatoes_rating: { type: DataTypes.FLOAT },
|
rotten_tomatoes_rating: { type: DataTypes.FLOAT },
|
||||||
|
}, {
|
||||||
|
timestamps: false,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ const EntrySeen = sequelize.define("entrySeen",
|
|||||||
date_seen: { type: DataTypes.DATE },
|
date_seen: { type: DataTypes.DATE },
|
||||||
seen_with: { type: DataTypes.STRING(50) },
|
seen_with: { type: DataTypes.STRING(50) },
|
||||||
|
|
||||||
|
}, {
|
||||||
|
timestamps: false,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,9 @@ const sequelize = require('../db/database');
|
|||||||
const Episode = sequelize.define("episode",
|
const Episode = sequelize.define("episode",
|
||||||
{
|
{
|
||||||
id: { type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true },
|
id: { type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true },
|
||||||
|
|
||||||
tmdb_id: { type: DataTypes.STRING(30) },
|
tmdb_id: { type: DataTypes.STRING(30) },
|
||||||
|
imdb_id: { type: DataTypes.STRING(30) },
|
||||||
|
|
||||||
season_id: {
|
season_id: {
|
||||||
type: DataTypes.INTEGER,
|
type: DataTypes.INTEGER,
|
||||||
@@ -24,6 +26,10 @@ const Episode = sequelize.define("episode",
|
|||||||
tmdb_rating: { type: DataTypes.FLOAT },
|
tmdb_rating: { type: DataTypes.FLOAT },
|
||||||
|
|
||||||
still_path: { type: DataTypes.STRING(60) },
|
still_path: { type: DataTypes.STRING(60) },
|
||||||
|
|
||||||
|
date_first_seen: { type: DataTypes.DATEONLY },
|
||||||
|
date_last_seen: { type: DataTypes.DATEONLY }
|
||||||
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ const Franchise = sequelize.define("franchise",
|
|||||||
title: { type: DataTypes.STRING(50) },
|
title: { type: DataTypes.STRING(50) },
|
||||||
overview: { type: DataTypes.STRING(300) },
|
overview: { type: DataTypes.STRING(300) },
|
||||||
user_rating: { type: DataTypes.FLOAT }
|
user_rating: { type: DataTypes.FLOAT }
|
||||||
|
}, {
|
||||||
|
timestamps: false,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
const { DataTypes } = require('sequelize');
|
||||||
|
const sequelize = require('../db/database');
|
||||||
|
|
||||||
|
const Genre = sequelize.define("genre",
|
||||||
|
{
|
||||||
|
id: { type: DataTypes.INTEGER, primaryKey: true },
|
||||||
|
|
||||||
|
name: { type: DataTypes.STRING(30) },
|
||||||
|
}, {
|
||||||
|
timestamps: false,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
module.exports = Genre;
|
||||||
@@ -4,7 +4,9 @@ const sequelize = require('../db/database');
|
|||||||
const Season = sequelize.define("season",
|
const Season = sequelize.define("season",
|
||||||
{
|
{
|
||||||
id: { type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true },
|
id: { type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true },
|
||||||
|
|
||||||
tmdb_id: { type: DataTypes.STRING(30) },
|
tmdb_id: { type: DataTypes.STRING(30) },
|
||||||
|
imdb_id: { type: DataTypes.STRING(30) },
|
||||||
|
|
||||||
entry_id: {
|
entry_id: {
|
||||||
type: DataTypes.INTEGER,
|
type: DataTypes.INTEGER,
|
||||||
@@ -17,10 +19,12 @@ const Season = sequelize.define("season",
|
|||||||
name: { type: DataTypes.STRING(30) },
|
name: { type: DataTypes.STRING(30) },
|
||||||
overview: { type: DataTypes.STRING(1000) },
|
overview: { type: DataTypes.STRING(1000) },
|
||||||
season_number: { type: DataTypes.INTEGER },
|
season_number: { type: DataTypes.INTEGER },
|
||||||
|
episode_count: { type: DataTypes.INTEGER },
|
||||||
air_date: { type: DataTypes.DATE },
|
air_date: { type: DataTypes.DATE },
|
||||||
|
|
||||||
user_rating: { type: DataTypes.FLOAT },
|
user_rating: { type: DataTypes.FLOAT },
|
||||||
tmdb_rating: { type: DataTypes.FLOAT },
|
tmdb_rating: { type: DataTypes.FLOAT },
|
||||||
|
imdb_rating: { type: DataTypes.FLOAT },
|
||||||
|
|
||||||
poster_path: { type: DataTypes.STRING(60) },
|
poster_path: { type: DataTypes.STRING(60) },
|
||||||
banner_path: { type: DataTypes.STRING(60) },
|
banner_path: { type: DataTypes.STRING(60) },
|
||||||
|
|||||||
Reference in new issue
Block a user