From d236e4c57a7f71589764efccd0cb36337d551055 Mon Sep 17 00:00:00 2001 From: Christian Hofmaier Date: Sat, 4 Aug 2018 23:42:49 +0000 Subject: [permissions] add permission management Add Roles Table with Delete Roles and Create Roles possibilities Add Users Table with Grant Roles and Revoke Roles possibilities --- .../20180804234000-create-role_x_group.js | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 server/migrations/20180804234000-create-role_x_group.js (limited to 'server/migrations/20180804234000-create-role_x_group.js') diff --git a/server/migrations/20180804234000-create-role_x_group.js b/server/migrations/20180804234000-create-role_x_group.js new file mode 100644 index 0000000..d9024be --- /dev/null +++ b/server/migrations/20180804234000-create-role_x_group.js @@ -0,0 +1,30 @@ +'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') + } +} \ No newline at end of file -- cgit v1.2.3-55-g7522