const { DataTypes } = require('sequelize'); module.exports = (sequelize) => { const Pitch = sequelize.define('pitch', { id: { allowNull: false, autoIncrement: true, primaryKey: true, type: DataTypes.INTEGER }, type: { type: DataTypes.INTEGER, allowNull: false, references: { // User belongsTo PitchType 1:1 model: 'PitchType', key: 'id' } }, bullpenSessionId: { type: DataTypes.INTEGER, allowNull: false, references: { // User belongsTo PitchType 1:1 model: 'BullpenSession', key: 'id' } }, aimedArea: { type: DataTypes.INTEGER, allowNull: false }, hitArea: { type: DataTypes.INTEGER, allowNull: false } }, { sequelize, modelName: 'Pitch', tableName: 'Pitches', }); return Pitch; };