25 lines
929 B
JavaScript
25 lines
929 B
JavaScript
const { DataTypes } = require("sequelize");
|
|
const sequelize = require("../config/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;
|