Files
Showy/backend/models/People.js
T

33 lines
1.2 KiB
JavaScript

const { DataTypes } = require('sequelize');
const sequelize = require('../config/database');
const People = sequelize.define("peoples",
{
id: { type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true },
tmdb_id: { type: DataTypes.STRING(100) },
name: { type: DataTypes.STRING(100) },
birthday: { type: DataTypes.DATEONLY },
deathday: { type: DataTypes.DATEONLY, allowNull: true },
gender: { type: DataTypes.INTEGER },
biography: { type: DataTypes.TEXT },
place_of_birth: { type: DataTypes.STRING(100), field: 'place_of_birth' },
adult: { type: DataTypes.BOOLEAN, defaultValue: false },
popularity: { type: DataTypes.FLOAT },
known_for_department: { type: DataTypes.STRING(50), field: 'known_for_department' },
homepage: { type: DataTypes.STRING(200), allowNull: true },
imdb_id: { type: DataTypes.STRING(20), field: 'imdb_id' },
profile_path: { type: DataTypes.STRING(200), field: 'profile_path' },
last_fetch: { type: DataTypes.DATEONLY, field: 'last_fetch' },
profile_update: { type: DataTypes.DATEONLY, field: 'profile_update' },
fully_fetched: { type: DataTypes.BOOLEAN, defaultValue: false },
}
);
module.exports = People;