'use strict';

module.exports = {
  async up(queryInterface, Sequelize) {
    await queryInterface.addColumn('Events', 'yearId', {
      type: Sequelize.INTEGER,
      allowNull: false,
      references: {
        model: 'EventYears',
        key: 'id'
      },
      onDelete: 'CASCADE',
      onUpdate: 'CASCADE'
    });
  },

  async down(queryInterface, Sequelize) {
    await queryInterface.removeColumn('Events', 'yearId');
  }
};
