'use strict';

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

  EventYear.associate = models => {
    EventYear.hasMany(models.Event, { foreignKey: 'yearId' });
  };

  return EventYear;
};
