From 1359e1982050c4798383fec4cdbeae96485bf285 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 23 Jun 2015 17:02:16 +0200 Subject: [PATCH] mysql.sql: fix missnamed fkey column --- schema/mysql-changes/upgrade_10.sql | 14 ++++++++++++++ schema/mysql.sql | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 schema/mysql-changes/upgrade_10.sql diff --git a/schema/mysql-changes/upgrade_10.sql b/schema/mysql-changes/upgrade_10.sql new file mode 100644 index 00000000..2709186b --- /dev/null +++ b/schema/mysql-changes/upgrade_10.sql @@ -0,0 +1,14 @@ +ALTER TABLE icinga_hostgroup_parent DROP FOREIGN KEY icinga_hostgroup_parent_parent; +ALTER TABLE icinga_hostgroup_parent ADD CONSTRAINT icinga_hostgroup_parent_parent + FOREIGN KEY parent (parent_hostgroup_id) + REFERENCES icinga_hostgroup (id) + ON DELETE RESTRICT + ON UPDATE CASCADE; + +ALTER TABLE icinga_usergroup_parent DROP FOREIGN KEY icinga_usergroup_parent_parent; +ALTER TABLE icinga_usergroup_parent ADD CONSTRAINT icinga_usergroup_parent_parent + FOREIGN KEY parent (parent_usergroup_id) + REFERENCES icinga_usergroup (id) + ON DELETE RESTRICT + ON UPDATE CASCADE; + diff --git a/schema/mysql.sql b/schema/mysql.sql index 5a7eccbb..59844e06 100644 --- a/schema/mysql.sql +++ b/schema/mysql.sql @@ -475,7 +475,7 @@ CREATE TABLE icinga_hostgroup_parent ( ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT icinga_hostgroup_parent_parent - FOREIGN KEY parent (hostgroup_id) + FOREIGN KEY parent (parent_hostgroup_id) REFERENCES icinga_hostgroup (id) ON DELETE RESTRICT ON UPDATE CASCADE @@ -594,7 +594,7 @@ CREATE TABLE icinga_usergroup_parent ( ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT icinga_usergroup_parent_parent - FOREIGN KEY parent (usergroup_id) + FOREIGN KEY parent (parent_usergroup_id) REFERENCES icinga_usergroup (id) ON DELETE RESTRICT ON UPDATE CASCADE