diff --git a/schema/mysql/schema.sql b/schema/mysql/schema.sql index f270d2b74..a1db99084 100644 --- a/schema/mysql/schema.sql +++ b/schema/mysql/schema.sql @@ -562,14 +562,14 @@ CREATE TABLE checkcommand_argument ( id binary(20) NOT NULL COMMENT 'sha1(environment.id + checkcommand_id + argument_key)', environment_id binary(20) NOT NULL COMMENT 'env.id', checkcommand_id binary(20) NOT NULL COMMENT 'checkcommand.id', - argument_key varchar(64) NOT NULL, + argument_key varchar(255) NOT NULL, properties_checksum binary(20) NOT NULL COMMENT 'sha1(all properties)', argument_value text DEFAULT NULL, argument_order smallint DEFAULT NULL, description text DEFAULT NULL, - argument_key_override varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + argument_key_override varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, repeat_key enum('n', 'y') NOT NULL, required enum('n', 'y') NOT NULL, set_if varchar(255) DEFAULT NULL, @@ -583,7 +583,7 @@ CREATE TABLE checkcommand_envvar ( id binary(20) NOT NULL COMMENT 'sha1(environment.id + checkcommand_id + envvar_key)', environment_id binary(20) NOT NULL COMMENT 'env.id', checkcommand_id binary(20) NOT NULL COMMENT 'checkcommand.id', - envvar_key varchar(64) NOT NULL, + envvar_key varchar(255) NOT NULL, properties_checksum binary(20) NOT NULL COMMENT 'sha1(all properties)', @@ -626,14 +626,14 @@ CREATE TABLE eventcommand_argument ( id binary(20) NOT NULL COMMENT 'sha1(environment.id + eventcommand_id + argument_key)', environment_id binary(20) NOT NULL COMMENT 'env.id', eventcommand_id binary(20) NOT NULL COMMENT 'eventcommand.id', - argument_key varchar(64) NOT NULL, + argument_key varchar(255) NOT NULL, properties_checksum binary(20) NOT NULL COMMENT 'sha1(all properties)', argument_value text DEFAULT NULL, argument_order smallint DEFAULT NULL, description text DEFAULT NULL, - argument_key_override varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + argument_key_override varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, repeat_key enum('n', 'y') NOT NULL, required enum('n', 'y') NOT NULL, set_if varchar(255) DEFAULT NULL, @@ -647,7 +647,7 @@ CREATE TABLE eventcommand_envvar ( id binary(20) NOT NULL COMMENT 'sha1(environment.id + eventcommand_id + envvar_key)', environment_id binary(20) NOT NULL COMMENT 'env.id', eventcommand_id binary(20) NOT NULL COMMENT 'eventcommand.id', - envvar_key varchar(64) NOT NULL, + envvar_key varchar(255) NOT NULL, properties_checksum binary(20) NOT NULL COMMENT 'sha1(all properties)', @@ -688,14 +688,14 @@ CREATE TABLE notificationcommand_argument ( id binary(20) NOT NULL COMMENT 'sha1(environment.id + notificationcommand_id + argument_key)', environment_id binary(20) NOT NULL COMMENT 'env.id', notificationcommand_id binary(20) NOT NULL COMMENT 'notificationcommand.id', - argument_key varchar(64) NOT NULL, + argument_key varchar(255) NOT NULL, properties_checksum binary(20) NOT NULL COMMENT 'sha1(all properties)', argument_value text DEFAULT NULL, argument_order smallint DEFAULT NULL, description text DEFAULT NULL, - argument_key_override varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + argument_key_override varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, repeat_key enum('n', 'y') NOT NULL, required enum('n', 'y') NOT NULL, set_if varchar(255) DEFAULT NULL, @@ -709,7 +709,7 @@ CREATE TABLE notificationcommand_envvar ( id binary(20) NOT NULL COMMENT 'sha1(environment.id + notificationcommand_id + envvar_key)', environment_id binary(20) NOT NULL COMMENT 'env.id', notificationcommand_id binary(20) NOT NULL COMMENT 'notificationcommand.id', - envvar_key varchar(64) NOT NULL, + envvar_key varchar(255) NOT NULL, properties_checksum binary(20) NOT NULL COMMENT 'sha1(all properties)', diff --git a/schema/mysql/upgrades/1.3.0.sql b/schema/mysql/upgrades/1.3.0.sql index ed86c6e72..047903807 100644 --- a/schema/mysql/upgrades/1.3.0.sql +++ b/schema/mysql/upgrades/1.3.0.sql @@ -7,5 +7,16 @@ ALTER TABLE notification MODIFY COLUMN properties_checksum binary(20) NOT NULL C ALTER TABLE timeperiod_range MODIFY COLUMN range_value text NOT NULL; +ALTER TABLE checkcommand_argument MODIFY COLUMN argument_key varchar(255) NOT NULL; +ALTER TABLE checkcommand_argument MODIFY COLUMN argument_key_override varchar(255) NOT NULL; +ALTER TABLE eventcommand_argument MODIFY COLUMN argument_key varchar(255) NOT NULL; +ALTER TABLE eventcommand_argument MODIFY COLUMN argument_key_override varchar(255) NOT NULL; +ALTER TABLE notificationcommand_argument MODIFY COLUMN argument_key varchar(255) NOT NULL; +ALTER TABLE notificationcommand_argument MODIFY COLUMN argument_key_override varchar(255) NOT NULL; + +ALTER TABLE checkcommand_envvar MODIFY COLUMN envvar_key varchar(255) NOT NULL; +ALTER TABLE eventcommand_envvar MODIFY COLUMN envvar_key varchar(255) NOT NULL; +ALTER TABLE notificationcommand_envvar MODIFY COLUMN envvar_key varchar(255) NOT NULL; + INSERT INTO icingadb_schema (version, timestamp) VALUES (6, UNIX_TIMESTAMP() * 1000); diff --git a/schema/pgsql/schema.sql b/schema/pgsql/schema.sql index 78db645f0..a68d41a1d 100644 --- a/schema/pgsql/schema.sql +++ b/schema/pgsql/schema.sql @@ -835,7 +835,7 @@ CREATE TABLE checkcommand_argument ( id bytea20 NOT NULL, environment_id bytea20 NOT NULL, checkcommand_id bytea20 NOT NULL, - argument_key varchar(64) NOT NULL, + argument_key varchar(255) NOT NULL, properties_checksum bytea20 NOT NULL, @@ -867,7 +867,7 @@ CREATE TABLE checkcommand_envvar ( id bytea20 NOT NULL, environment_id bytea20 NOT NULL, checkcommand_id bytea20 NOT NULL, - envvar_key varchar(64) NOT NULL, + envvar_key varchar(255) NOT NULL, properties_checksum bytea20 NOT NULL, @@ -941,7 +941,7 @@ CREATE TABLE eventcommand_argument ( id bytea20 NOT NULL, environment_id bytea20 NOT NULL, eventcommand_id bytea20 NOT NULL, - argument_key varchar(64) NOT NULL, + argument_key varchar(255) NOT NULL, properties_checksum bytea20 NOT NULL, @@ -972,7 +972,7 @@ CREATE TABLE eventcommand_envvar ( id bytea20 NOT NULL, environment_id bytea20 NOT NULL, eventcommand_id bytea20 NOT NULL, - envvar_key varchar(64) NOT NULL, + envvar_key varchar(255) NOT NULL, properties_checksum bytea20 NOT NULL, @@ -1045,7 +1045,7 @@ CREATE TABLE notificationcommand_argument ( id bytea20 NOT NULL, environment_id bytea20 NOT NULL, notificationcommand_id bytea20 NOT NULL, - argument_key varchar(64) NOT NULL, + argument_key varchar(255) NOT NULL, properties_checksum bytea20 NOT NULL, @@ -1076,7 +1076,7 @@ CREATE TABLE notificationcommand_envvar ( id bytea20 NOT NULL, environment_id bytea20 NOT NULL, notificationcommand_id bytea20 NOT NULL, - envvar_key varchar(64) NOT NULL, + envvar_key varchar(255) NOT NULL, properties_checksum bytea20 NOT NULL, diff --git a/schema/pgsql/upgrades/1.3.0.sql b/schema/pgsql/upgrades/1.3.0.sql index 5989e3a77..80d75f5d3 100644 --- a/schema/pgsql/upgrades/1.3.0.sql +++ b/schema/pgsql/upgrades/1.3.0.sql @@ -7,5 +7,13 @@ COMMENT ON COLUMN notification.properties_checksum IS 'sha1(all properties)'; ALTER TABLE timeperiod_range ALTER COLUMN range_value TYPE text; +ALTER TABLE checkcommand_argument ALTER COLUMN argument_key TYPE varchar(255); +ALTER TABLE eventcommand_argument ALTER COLUMN argument_key TYPE varchar(255); +ALTER TABLE notificationcommand_argument ALTER COLUMN argument_key TYPE varchar(255); + +ALTER TABLE checkcommand_envvar ALTER COLUMN envvar_key TYPE varchar(255); +ALTER TABLE eventcommand_envvar ALTER COLUMN envvar_key TYPE varchar(255); +ALTER TABLE notificationcommand_envvar ALTER COLUMN envvar_key TYPE varchar(255); + INSERT INTO icingadb_schema (version, timestamp) VALUES (4, extract(epoch from now()) * 1000);