summaryrefslogblamecommitdiffstats
path: root/server/migrations/20190221050800-create-role_x_group.js
blob: e457f875c8d906b96462882855132b94ffd27770 (plain) (tree)
1
2
3
4
5
6
7
8
9







                                                       
                            








                                
                            



                          


                               





                                                   
 
'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'
        }
      },
      blacklist: {
        type: Sequelize.BOOLEAN
      }
    })
  },
  down: (queryInterface, Sequelize) => {
    return queryInterface.dropTable('role_x_group')
  }
}