summaryrefslogtreecommitdiffstats
path: root/server/migrations/20181009154133-create-registrationhook_x_group.js
diff options
context:
space:
mode:
authorJannik Schönartz2018-10-10 17:00:56 +0200
committerJannik Schönartz2018-10-10 17:00:56 +0200
commit353761b07015a26841549cc259ae0687bc8e4865 (patch)
tree4df55e5d5990a2d0bc150dd5d1c768915f2d3dff /server/migrations/20181009154133-create-registrationhook_x_group.js
parent[webapp/configurator] fix deleted configs/entries still being selected after ... (diff)
downloadbas-353761b07015a26841549cc259ae0687bc8e4865.tar.gz
bas-353761b07015a26841549cc259ae0687bc8e4865.tar.xz
bas-353761b07015a26841549cc259ae0687bc8e4865.zip
[registration] Add dbs and code for the registration scripts
Add Table for the registration hooks. Add Table for the hooks - groups association. Add nexthook for the minilinux to pull the next bash script. Add state for setting the new script after completing the current one.
Diffstat (limited to 'server/migrations/20181009154133-create-registrationhook_x_group.js')
-rw-r--r--server/migrations/20181009154133-create-registrationhook_x_group.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/server/migrations/20181009154133-create-registrationhook_x_group.js b/server/migrations/20181009154133-create-registrationhook_x_group.js
new file mode 100644
index 0000000..5d52a5b
--- /dev/null
+++ b/server/migrations/20181009154133-create-registrationhook_x_group.js
@@ -0,0 +1,30 @@
+'use strict'
+module.exports = {
+ up: (queryInterface, Sequelize) => {
+ return queryInterface.createTable('registrationhook_x_group', {
+ registrationhookId: {
+ primaryKey: true,
+ allowNull: false,
+ type: Sequelize.INTEGER,
+ onDelete: 'cascade',
+ references: {
+ model: 'registrationhooks',
+ key: 'id'
+ }
+ },
+ groupId: {
+ primaryKey: true,
+ allowNull: false,
+ type: Sequelize.INTEGER,
+ onDelete: 'cascade',
+ references: {
+ model: 'groups',
+ key: 'id'
+ }
+ }
+ })
+ },
+ down: (queryInterface, Sequelize) => {
+ return queryInterface.dropTable('registrationhook_x_group')
+ }
+}