From 1ee0e6c1d7484930387438b7ebb15340595b5383 Mon Sep 17 00:00:00 2001 From: Christian Hofmaier Date: Sun, 24 Mar 2019 16:02:18 +0000 Subject: [eventmanager] Add module and functionality - list to show all events, buttons to create/delete events - can add groups/clients to event - can add blacklist to event --- server/migrations/20190226151600-create-event.js | 31 ++++++++++++++++++++ .../20190226152330-create-client_x_event.js | 33 ++++++++++++++++++++++ .../20190226152400-create-group_x_event.js | 33 ++++++++++++++++++++++ 3 files changed, 97 insertions(+) create mode 100644 server/migrations/20190226151600-create-event.js create mode 100644 server/migrations/20190226152330-create-client_x_event.js create mode 100644 server/migrations/20190226152400-create-group_x_event.js (limited to 'server/migrations') diff --git a/server/migrations/20190226151600-create-event.js b/server/migrations/20190226151600-create-event.js new file mode 100644 index 0000000..59cab86 --- /dev/null +++ b/server/migrations/20190226151600-create-event.js @@ -0,0 +1,31 @@ +'use strict' +module.exports = { + up: (queryInterface, Sequelize) => { + return queryInterface.createTable('events', { + id: { + allowNull: false, + autoIncrement: true, + primaryKey: true, + type: Sequelize.INTEGER + }, + name: { + type: Sequelize.STRING + }, + description: { + type: Sequelize.STRING(2048) + }, + config: { + type: Sequelize.INTEGER + }, + times: { + type: Sequelize.STRING(4096) + }, + important: { + type: Sequelize.BOOLEAN + } + }) + }, + down: (queryInterface, Sequelize) => { + return queryInterface.dropTable('permissions') + } +} diff --git a/server/migrations/20190226152330-create-client_x_event.js b/server/migrations/20190226152330-create-client_x_event.js new file mode 100644 index 0000000..1d6952e --- /dev/null +++ b/server/migrations/20190226152330-create-client_x_event.js @@ -0,0 +1,33 @@ +'use strict' +module.exports = { + up: (queryInterface, Sequelize) => { + return queryInterface.createTable('client_x_event', { + clientId: { + primaryKey: true, + allowNull: false, + type: Sequelize.INTEGER, + onDelete: 'cascade', + references: { + model: 'clients', + 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('client_x_event') + } +} diff --git a/server/migrations/20190226152400-create-group_x_event.js b/server/migrations/20190226152400-create-group_x_event.js new file mode 100644 index 0000000..8c438de --- /dev/null +++ b/server/migrations/20190226152400-create-group_x_event.js @@ -0,0 +1,33 @@ +'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') + } +} -- cgit v1.2.3-55-g7522