diff --git a/schema/mysql/schema.sql b/schema/mysql/schema.sql index 5c834a74..2f9ea01d 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', @@ -943,8 +943,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 be17a0d3..7f1bb6fa 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;