summaryrefslogblamecommitdiffstats
path: root/server/migrations/20180717202533-create-group_x_client.js
blob: 2330cdbc2c4b4c336c5ab61635c335b7b1a6894f (plain) (tree)
1
2
3
4
5
6
7
8
9







                                                         
                            








                                
                            










                                                     
'use strict'
module.exports = {
  up: (queryInterface, Sequelize) => {
    return queryInterface.createTable('group_x_client', {
      groupId: {
        primaryKey: true,
        allowNull: false,
        type: Sequelize.INTEGER,
        onDelete: "cascade",
        references: {
          model: 'groups',
          key: 'id'
        }
      },
      clientId: {
        primaryKey: true,
        allowNull: false,
        type: Sequelize.INTEGER,
        onDelete: "cascade",
        references: {
          model: 'clients',
          key: 'id'
        }
      }
    })
  },
  down: (queryInterface, Sequelize) => {
    return queryInterface.dropTable('group_x_client')
  }
}