summaryrefslogblamecommitdiffstats
path: root/server/migrations/20190226152400-create-group_x_event.js
blob: 8c438de64bc86dc26e035d3e29318a91e8ce10b5 (plain) (tree)
































                                                        
'use strict'
module.exports = {
  up: (queryInterface, Sequelize) => {
    return queryInterface.createTable('group_x_event', {
      groupId: {
        primaryKey: true,
        allowNull: false,
        type: Sequelize.INTEGER,
        onDelete: 'cascade',
        references: {
          model: 'groups',
          key: 'id'
        }
      },
      eventId: {
        primaryKey: true,
        allowNull: false,
        type: Sequelize.INTEGER,
        onDelete: 'cascade',
        references: {
          model: 'events',
          key: 'id'
        }
      },
      blacklist: {
        type: Sequelize.BOOLEAN
      }
    })
  },
  down: (queryInterface, Sequelize) => {
    return queryInterface.dropTable('group_x_event')
  }
}