'use strict';

module.exports = (sequelize, DataTypes) => {
  const TeamYear = sequelize.define('TeamYear', {
    label: {
      type: DataTypes.STRING,
      allowNull: false
    }
  });

  TeamYear.associate = models => {
    TeamYear.hasMany(models.OurTeamMember, {
      foreignKey: 'yearId',
      onDelete: 'CASCADE'
    });
  };

  return TeamYear;
};
