summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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')
+ }
+}