Back: reworked the media/entry relation

This commit is contained in:
X4Lo committed 2024-09-10 21:32:46 +01:00
1 parent d06a21097f
commit b42e055691
5 files changed
+41 -30

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
const { DataTypes } = require('sequelize');
const sequelize = require('../db/database');
const Collection = sequelize.define("userCollection",
{
id: { type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true },
tmdbId: { type: DataTypes.STRING(30), field: 'tmdb_id' },
imdbId: { type: DataTypes.STRING(30), field: 'imdb_id' },
tvdbId: { type: DataTypes.STRING(30), field: 'tvdb_id' },
name: { type: DataTypes.STRING(150) },
description: { type: DataTypes.STRING(3000) },
isUserCollection: { type: DataTypes.BOOLEAN, defaultValue: false, field: 'is_user_collection' },
userRating: { type: DataTypes.FLOAT, field: 'user_rating' },
posterPath: { type: DataTypes.STRING(200), field: 'poster_path' },
backdropPath: { type: DataTypes.STRING(200), field: 'backdrop_path' },
isLocal: { type: DataTypes.BOOLEAN, defaultValue: false, field: 'is_local' }
}
);
module.exports = Collection;