From a64d7d307275e5ed054e9fca12c054c2073d4ef3 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Mon, 26 Oct 2015 12:36:36 +0100 Subject: [PATCH] schema/mysql: fix copy & paste errors --- schema/mysql-changes/upgrade_41.sql | 19 +++++++++++++++++++ schema/mysql.sql | 6 +++--- 2 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 schema/mysql-changes/upgrade_41.sql diff --git a/schema/mysql-changes/upgrade_41.sql b/schema/mysql-changes/upgrade_41.sql new file mode 100644 index 00000000..0ddb9b67 --- /dev/null +++ b/schema/mysql-changes/upgrade_41.sql @@ -0,0 +1,19 @@ +DROP TABLE icinga_command_field; + +CREATE TABLE icinga_command_field ( + command_id INT(10) UNSIGNED NOT NULL, + datafield_id INT(10) UNSIGNED NOT NULL, + is_required ENUM('y', 'n') NOT NULL, + PRIMARY KEY (command_id, datafield_id), + CONSTRAINT icinga_command_field_command + FOREIGN KEY command_id (command_id) + REFERENCES icinga_command (id) + ON DELETE CASCADE + ON UPDATE CASCADE, + CONSTRAINT icinga_command_field_datafield + FOREIGN KEY datafield(datafield_id) + REFERENCES director_datafield (id) + ON DELETE CASCADE + ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + diff --git a/schema/mysql.sql b/schema/mysql.sql index 376e3daf..e29a24be 100644 --- a/schema/mysql.sql +++ b/schema/mysql.sql @@ -293,9 +293,9 @@ CREATE TABLE icinga_command_field ( datafield_id INT(10) UNSIGNED NOT NULL, is_required ENUM('y', 'n') NOT NULL, PRIMARY KEY (command_id, datafield_id), - CONSTRAINT icinga_command_field_command_argument - FOREIGN KEY host(command_id) - REFERENCES icinga_command_argument (id) + CONSTRAINT icinga_command_field_command + FOREIGN KEY command_id (command_id) + REFERENCES icinga_command (id) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT icinga_command_field_datafield