bullpen/backend/models/pitchType.model.js

30 lines
692 B
JavaScript

'use strict';
const { Model } = require('sequelize');
module.exports = (sequelize, DataTypes) => {
class PitchType extends Model {
/**
* Helper method for defining associations.
* This method is not a part of Sequelize lifecycle.
* The `models/index` file will call this method automatically.
*/
static associate(models) {
// define association here
}
}
PitchType.init({
name: {
type: DataTypes.STRING,
allowNull: false,
unique: true
},
abbreviation: {
type: DataTypes.STRING,
allowNull: false
}
}, {
sequelize,
modelName: 'PitchType',
tableName: 'PitchTypes'
});
return PitchType;
};