From b9ec99185a58b0294d08185a4249aa6e5c7fd71b Mon Sep 17 00:00:00 2001 From: Noah Hilverling Date: Tue, 10 Aug 2021 11:14:19 +0200 Subject: [PATCH] Schema: Add description to downtime columns 'triggered_by_id' and 'parent_id' --- schema/mysql/schema.sql | 8 ++++---- schema/mysql/upgrades/1.0.0-rc2.sql | 8 ++++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/schema/mysql/schema.sql b/schema/mysql/schema.sql index 63dddb03..4ba9ab34 100644 --- a/schema/mysql/schema.sql +++ b/schema/mysql/schema.sql @@ -573,8 +573,8 @@ CREATE TABLE downtime ( id binary(20) NOT NULL COMMENT 'sha1(environment.name + name)', environment_id binary(20) NOT NULL COMMENT 'environment.id', - triggered_by_id binary(20) DEFAULT NULL COMMENT 'downtime.id', - parent_id binary(20) DEFAULT NULL COMMENT 'downtime.id', + triggered_by_id binary(20) DEFAULT NULL COMMENT 'The ID of the downtime that triggered this downtime. This is set when creating downtimes on a host or service higher up in the dependency chain using the "child_option" "DowntimeTriggeredChildren" and can also be set manually via the API.', + parent_id binary(20) DEFAULT NULL COMMENT 'For service downtimes, the ID of the host downtime that created this downtime by using the "all_services" flag of the schedule-downtime API.', object_type enum('host', 'service') NOT NULL, host_id binary(20) NOT NULL COMMENT 'host.id', service_id binary(20) DEFAULT NULL COMMENT 'service.id', @@ -942,8 +942,8 @@ CREATE TABLE downtime_history ( downtime_id binary(20) NOT NULL COMMENT 'downtime.id', environment_id binary(20) NOT NULL COMMENT 'environment.id', endpoint_id binary(20) DEFAULT NULL COMMENT 'endpoint.id', - triggered_by_id binary(20) DEFAULT NULL COMMENT 'downtime.id', - parent_id binary(20) DEFAULT NULL COMMENT 'downtime.id', + triggered_by_id binary(20) DEFAULT NULL COMMENT 'The ID of the downtime that triggered this downtime. This is set when creating downtimes on a host or service higher up in the dependency chain using the "child_option" "DowntimeTriggeredChildren" and can also be set manually via the API.', + parent_id binary(20) DEFAULT NULL COMMENT 'For service downtimes, the ID of the host downtime that created this downtime by using the "all_services" flag of the schedule-downtime API.', object_type enum('host', 'service') NOT NULL, host_id binary(20) NOT NULL COMMENT 'host.id', service_id binary(20) DEFAULT NULL COMMENT 'service.id', diff --git a/schema/mysql/upgrades/1.0.0-rc2.sql b/schema/mysql/upgrades/1.0.0-rc2.sql index 30f5f31c..ea6b9a49 100644 --- a/schema/mysql/upgrades/1.0.0-rc2.sql +++ b/schema/mysql/upgrades/1.0.0-rc2.sql @@ -16,8 +16,12 @@ UPDATE service_state SET properties_checksum = 0; ALTER TABLE service_state MODIFY COLUMN properties_checksum binary(20) COMMENT 'sha1(all properties)' NOT NULL; ALTER TABLE service_state ADD UNIQUE INDEX idx_service_state_service_id (service_id); -ALTER TABLE downtime ADD COLUMN parent_id binary(20) AFTER triggered_by_id; -ALTER TABLE downtime_history ADD COLUMN parent_id binary(20) AFTER triggered_by_id; +ALTER TABLE downtime + ADD COLUMN parent_id binary(20) COMMENT 'For service downtimes, the ID of the host downtime that created this downtime by using the "all_services" flag of the schedule-downtime API.' AFTER triggered_by_id, + MODIFY COLUMN triggered_by_id binary(20) COMMENT 'The ID of the downtime that triggered this downtime. This is set when creating downtimes on a host or service higher up in the dependency chain using the "child_option" "DowntimeTriggeredChildren" and can also be set manually via the API.'; +ALTER TABLE downtime_history + ADD COLUMN parent_id binary(20) COMMENT 'For service downtimes, the ID of the host downtime that created this downtime by using the "all_services" flag of the schedule-downtime API.' AFTER triggered_by_id, + MODIFY COLUMN triggered_by_id binary(20) COMMENT 'The ID of the downtime that triggered this downtime. This is set when creating downtimes on a host or service higher up in the dependency chain using the "child_option" "DowntimeTriggeredChildren" and can also be set manually via the API.'; ALTER TABLE checkcommand_argument MODIFY COLUMN argument_order smallint DEFAULT NULL; ALTER TABLE eventcommand_argument MODIFY COLUMN argument_order smallint DEFAULT NULL;