summaryrefslogtreecommitdiffstats
path: root/server/migrations
diff options
context:
space:
mode:
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')
+ }
+}