summaryrefslogtreecommitdiffstats
path: root/server/migrations
diff options
context:
space:
mode:
authorChristian Hofmaier2019-04-03 03:26:36 +0200
committerChristian Hofmaier2019-04-03 03:26:36 +0200
commit24b5c99553c0ba019aa1f223466fef895349d07e (patch)
treed126839d5ad81e533283ad99e79f8d256869fa65 /server/migrations
parent[configloader] implement time filter for events (diff)
downloadbas-24b5c99553c0ba019aa1f223466fef895349d07e.tar.gz
bas-24b5c99553c0ba019aa1f223466fef895349d07e.tar.xz
bas-24b5c99553c0ba019aa1f223466fef895349d07e.zip
[eventmanager] fix configId reference in migration
Diffstat (limited to 'server/migrations')
-rw-r--r--server/migrations/20190226151600-create-event.js5
-rw-r--r--server/migrations/20190402032400-add-configid-event.js16
2 files changed, 17 insertions, 4 deletions
diff --git a/server/migrations/20190226151600-create-event.js b/server/migrations/20190226151600-create-event.js
index 59cab86..502bf44 100644
--- a/server/migrations/20190226151600-create-event.js
+++ b/server/migrations/20190226151600-create-event.js
@@ -14,9 +14,6 @@ module.exports = {
description: {
type: Sequelize.STRING(2048)
},
- config: {
- type: Sequelize.INTEGER
- },
times: {
type: Sequelize.STRING(4096)
},
@@ -26,6 +23,6 @@ module.exports = {
})
},
down: (queryInterface, Sequelize) => {
- return queryInterface.dropTable('permissions')
+ return queryInterface.dropTable('events')
}
}
diff --git a/server/migrations/20190402032400-add-configid-event.js b/server/migrations/20190402032400-add-configid-event.js
new file mode 100644
index 0000000..fa44b52
--- /dev/null
+++ b/server/migrations/20190402032400-add-configid-event.js
@@ -0,0 +1,16 @@
+'use strict'
+module.exports = {
+ up: (queryInterface, Sequelize) => {
+ return queryInterface.addColumn('events', 'configId', {
+ type: Sequelize.INTEGER,
+ onDelete: 'SET NULL',
+ references: {
+ model: 'configs',
+ key: 'id'
+ }
+ })
+ },
+ down: (queryInterface, Sequelize) => {
+ return queryInterface.removeColumn('events', 'configId')
+ }
+}