From 611b94368b78ce2a71b36364b8f634a0ef37bc19 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Mon, 3 Aug 2015 13:51:26 +0200 Subject: [PATCH] schema: rename value_format to argument_format --- schema/mysql-changes/upgrade_35.sql | 6 ++++++ schema/mysql.sql | 4 ++-- schema/pgsql-changes/upgrade_35.sql | 2 ++ schema/pgsql.sql | 4 ++-- 4 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 schema/mysql-changes/upgrade_35.sql create mode 100644 schema/pgsql-changes/upgrade_35.sql diff --git a/schema/mysql-changes/upgrade_35.sql b/schema/mysql-changes/upgrade_35.sql new file mode 100644 index 00000000..166a06f1 --- /dev/null +++ b/schema/mysql-changes/upgrade_35.sql @@ -0,0 +1,6 @@ +ALTER TABLE icinga_command_argument DROP COLUMN value_format, ADD COLUMN argument_format ENUM('string', 'expression', 'json') NOT NULL DEFAULT 'string' AFTER argument_value; +ALTER TABLE icinga_command_argument DEFAULT COLLATE utf8_bin; +ALTER TABLE icinga_command_argument MODIFY COLUMN argument_name VARCHAR(64) DEFAULT NULL COLLATE utf8_bin; + + + diff --git a/schema/mysql.sql b/schema/mysql.sql index 0eaa9f7c..123bddb4 100644 --- a/schema/mysql.sql +++ b/schema/mysql.sql @@ -263,14 +263,14 @@ CREATE TABLE icinga_command_argument ( command_id INT(10) UNSIGNED NOT NULL, argument_name VARCHAR(64) DEFAULT NULL COMMENT '-x, --host', argument_value TEXT DEFAULT NULL, + argument_format ENUM('string', 'expression', 'json') NOT NULL DEFAULT 'string', key_string VARCHAR(64) DEFAULT NULL COMMENT 'Overrides name', description TEXT DEFAULT NULL, skip_key ENUM('y', 'n') DEFAULT NULL, set_if VARCHAR(255) DEFAULT NULL, -- (string expression, must resolve to a numeric value) + set_if_format ENUM('string', 'expression', 'json') DEFAULT NULL, sort_order SMALLINT DEFAULT NULL, -- -> order repeat_key ENUM('y', 'n') DEFAULT NULL COMMENT 'Useful with array values', - value_format ENUM('string', 'expression', 'json') NOT NULL DEFAULT 'string', - 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), diff --git a/schema/pgsql-changes/upgrade_35.sql b/schema/pgsql-changes/upgrade_35.sql new file mode 100644 index 00000000..b5e1294b --- /dev/null +++ b/schema/pgsql-changes/upgrade_35.sql @@ -0,0 +1,2 @@ +ALTER TABLE icinga_command_argument DROP COLUMN value_format, ADD COLUMN argument_format enum_property_format NOT NULL DEFAULT 'string'; + diff --git a/schema/pgsql.sql b/schema/pgsql.sql index b60f5787..284aac66 100644 --- a/schema/pgsql.sql +++ b/schema/pgsql.sql @@ -311,14 +311,14 @@ CREATE TABLE icinga_command_argument ( command_id integer NOT NULL, argument_name character varying(64) DEFAULT NULL, argument_value text DEFAULT NULL, + argument_format enum_property_format NOT NULL DEFAULT 'string', key_string character varying(64) DEFAULT NULL, description text DEFAULT NULL, skip_key enum_boolean DEFAULT NULL, set_if character varying(255) DEFAULT NULL, -- (string expression, must resolve to a numeric value) + set_if_format enum_property_format DEFAULT NULL, sort_order smallint DEFAULT NULL, -- -> order repeat_key enum_boolean DEFAULT NULL, - value_format enum_property_format NOT NULL DEFAULT 'string', - set_if_format enum_property_format DEFAULT NULL, PRIMARY KEY (id), CONSTRAINT icinga_command_argument_command FOREIGN KEY (command_id)