summaryrefslogtreecommitdiffstats
path: root/server/migrations
diff options
context:
space:
mode:
authorChristian Hofmaier2019-03-24 17:02:18 +0100
committerChristian Hofmaier2019-03-24 17:02:18 +0100
commit1ee0e6c1d7484930387438b7ebb15340595b5383 (patch)
treecff87a96c777b9fee0c3e066d1bd6d88763f1915 /server/migrations
parent[webapp] small design fixes (diff)
downloadbas-1ee0e6c1d7484930387438b7ebb15340595b5383.tar.gz
bas-1ee0e6c1d7484930387438b7ebb15340595b5383.tar.xz
bas-1ee0e6c1d7484930387438b7ebb15340595b5383.zip
[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
Diffstat (limited to 'server/migrations')
-rw-r--r--server/migrations/20190226151600-create-event.js31
-rw-r--r--server/migrations/20190226152330-create-client_x_event.js33
-rw-r--r--server/migrations/20190226152400-create-group_x_event.js33
3 files changed, 97 insertions, 0 deletions
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')
+ }
+}