From 20932daf5ab54721118726d78340e78d0793cbe3 Mon Sep 17 00:00:00 2001 From: Udo Walter Date: Mon, 17 Sep 2018 21:34:40 +0000 Subject: add ipxe config relation to groups and clients --- server/migrations/20180917232533-add-configid-group.js | 16 ++++++++++++++++ server/migrations/20180917232633-add-configid-client.js | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 server/migrations/20180917232533-add-configid-group.js create mode 100644 server/migrations/20180917232633-add-configid-client.js (limited to 'server/migrations') 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') + } +} -- cgit v1.2.3-55-g7522