schema: unique constraint on command argument

This commit is contained in:
Thomas Gelf 2015-06-01 16:36:57 +02:00
parent 01078199a6
commit c118b24056
2 changed files with 2 additions and 0 deletions

View File

@ -0,0 +1 @@
ALTER TABLE icinga_command_argument ADD UNIQUE KEY unique_idx (command_id, argument_name);

View File

@ -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)