diff --git a/schema/mysql-changes/upgrade_2.sql b/schema/mysql-changes/upgrade_2.sql new file mode 100644 index 00000000..04f37333 --- /dev/null +++ b/schema/mysql-changes/upgrade_2.sql @@ -0,0 +1 @@ +ALTER TABLE icinga_command_argument ADD UNIQUE KEY unique_idx (command_id, argument_name); diff --git a/schema/mysql.sql b/schema/mysql.sql index c846f5c1..06b486a1 100644 --- a/schema/mysql.sql +++ b/schema/mysql.sql @@ -195,6 +195,7 @@ CREATE TABLE icinga_command_argument ( set_if_format ENUM('string', 'expression', 'json') DEFAULT NULL, PRIMARY KEY (id), UNIQUE INDEX sort_idx (command_id, sort_order), + UNIQUE KEY unique_idx (command_id, argument_name), CONSTRAINT icinga_command_argument_command FOREIGN KEY command (command_id) REFERENCES icinga_command (id)