summaryrefslogblamecommitdiffstats
path: root/server/migrations/20180804234000-create-role_x_group.js
blob: d9024be1193312751c7824b34c7ad97f8793b6a9 (plain) (tree)





























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