schema: allow for required arguments

This commit is contained in:
Thomas Gelf 2016-03-21 02:44:50 +01:00
parent a6be710379
commit c7578bd7ef
4 changed files with 15 additions and 2 deletions

View File

@ -0,0 +1,6 @@
ALTER TABLE icinga_command_argument
ADD required ENUM('y', 'n') DEFAULT NULL AFTER repeat_key;
INSERT INTO director_schema_migration
SET migration_time = NOW(),
schema_version = 89;

View File

@ -289,6 +289,7 @@ CREATE TABLE icinga_command_argument (
set_if_format ENUM('string', 'expression', 'json') DEFAULT NULL, set_if_format ENUM('string', 'expression', 'json') DEFAULT NULL,
sort_order SMALLINT DEFAULT NULL, -- -> order sort_order SMALLINT DEFAULT NULL, -- -> order
repeat_key ENUM('y', 'n') DEFAULT NULL COMMENT 'Useful with array values', repeat_key ENUM('y', 'n') DEFAULT NULL COMMENT 'Useful with array values',
required ENUM('y', 'n') DEFAULT NULL,
PRIMARY KEY (id), PRIMARY KEY (id),
UNIQUE KEY unique_idx (command_id, argument_name), UNIQUE KEY unique_idx (command_id, argument_name),
INDEX sort_idx (command_id, sort_order), INDEX sort_idx (command_id, sort_order),
@ -1257,4 +1258,4 @@ CREATE TABLE sync_run (
INSERT INTO director_schema_migration INSERT INTO director_schema_migration
SET migration_time = NOW(), SET migration_time = NOW(),
schema_version = 87; schema_version = 89;

View File

@ -0,0 +1,5 @@
ALTER TABLE icinga_command_argument ADD required enum_boolean DEFAULT NULL;
INSERT INTO director_schema_migration
(schema_version, migration_time)
VALUES (89, NOW());

View File

@ -376,6 +376,7 @@ CREATE TABLE icinga_command_argument (
set_if_format enum_property_format DEFAULT NULL, set_if_format enum_property_format DEFAULT NULL,
sort_order smallint DEFAULT NULL, -- -> order sort_order smallint DEFAULT NULL, -- -> order
repeat_key enum_boolean DEFAULT NULL, repeat_key enum_boolean DEFAULT NULL,
required enum_boolean DEFAULT NULL,
PRIMARY KEY (id), PRIMARY KEY (id),
CONSTRAINT icinga_command_argument_command CONSTRAINT icinga_command_argument_command
FOREIGN KEY (command_id) FOREIGN KEY (command_id)
@ -1470,4 +1471,4 @@ CREATE UNIQUE INDEX notification_inheritance ON icinga_notification_inheritance
-- set current schema version -- set current schema version
INSERT INTO director_schema_migration INSERT INTO director_schema_migration
(schema_version, migration_time) (schema_version, migration_time)
VALUES (88, NOW()); VALUES (89, NOW());