summaryrefslogtreecommitdiffstats
path: root/server/migrations
diff options
context:
space:
mode:
authorUdo Walter2018-09-17 23:34:40 +0200
committerUdo Walter2018-09-17 23:34:40 +0200
commit20932daf5ab54721118726d78340e78d0793cbe3 (patch)
tree5da3385a404554736ce107aa49e49d8596fd7172 /server/migrations
parentadd ipxe entry and config database migrations and models (diff)
downloadbas-20932daf5ab54721118726d78340e78d0793cbe3.tar.gz
bas-20932daf5ab54721118726d78340e78d0793cbe3.tar.xz
bas-20932daf5ab54721118726d78340e78d0793cbe3.zip
add ipxe config relation to groups and clients
Diffstat (limited to 'server/migrations')
-rw-r--r--server/migrations/20180917232533-add-configid-group.js16
-rw-r--r--server/migrations/20180917232633-add-configid-client.js16
2 files changed, 32 insertions, 0 deletions
diff --git a/server/migrations/20180917232533-add-configid-group.js b/server/migrations/20180917232533-add-configid-group.js
new file mode 100644
index 0000000..4a924fd
--- /dev/null
+++ b/server/migrations/20180917232533-add-configid-group.js
@@ -0,0 +1,16 @@
+'use strict'
+module.exports = {
+ up: (queryInterface, Sequelize) => {
+ return queryInterface.addColumn('groups', 'configId', {
+ type: Sequelize.INTEGER,
+ onDelete: 'SET NULL',
+ references: {
+ model: 'configs',
+ key: 'id'
+ }
+ })
+ },
+ down: (queryInterface, Sequelize) => {
+ return queryInterface.removeColumn('groups', 'configId')
+ }
+}
diff --git a/server/migrations/20180917232633-add-configid-client.js b/server/migrations/20180917232633-add-configid-client.js
new file mode 100644
index 0000000..4ff4bbb
--- /dev/null
+++ b/server/migrations/20180917232633-add-configid-client.js
@@ -0,0 +1,16 @@
+'use strict'
+module.exports = {
+ up: (queryInterface, Sequelize) => {
+ return queryInterface.addColumn('clients', 'configId', {
+ type: Sequelize.INTEGER,
+ onDelete: 'SET NULL',
+ references: {
+ model: 'configs',
+ key: 'id'
+ }
+ })
+ },
+ down: (queryInterface, Sequelize) => {
+ return queryInterface.removeColumn('clients', 'configId')
+ }
+}