diff --git a/configobject/history/history.go b/configobject/history/history.go index ce5ba0e7..841f6b9c 100644 --- a/configobject/history/history.go +++ b/configobject/history/history.go @@ -168,7 +168,7 @@ func stateHistoryWorker(super *supervisor.Supervisor, objectType string) { func downtimeHistoryWorker(super *supervisor.Supervisor, objectType string) { statements := []string{ `REPLACE INTO ` + objectType + `_downtime_history (downtime_id, environment_id, ` + objectType + `_id, triggered_by_id, entry_time,` + - `author, comment, is_fixed, duration, scheduled_start_time, scheduled_end_time, was_started, actual_start_time, actual_end_time, was_cancelled, is_in_effect, trigger_time, deletion_time)` + + `author, comment, is_flexible, duration, scheduled_start_time, scheduled_end_time, was_started, actual_start_time, actual_end_time, was_cancelled, is_in_effect, trigger_time, deletion_time)` + `VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)`, `REPLACE INTO `+objectType+`_history (id, environment_id, `+objectType+`_id, notification_history_id,` + `state_history_id, downtime_history_id, comment_history_id, flapping_history_id, event_type, event_time)` + @@ -190,7 +190,7 @@ func downtimeHistoryWorker(super *supervisor.Supervisor, objectType string) { values["entry_time"], values["author"], values["comment"], - utils.RedisIntToDBBoolean(values["is_fixed"]), + utils.RedisIntToDBBoolean(values["is_flexible"]), values["duration"], values["scheduled_start_time"], values["scheduled_end_time"], diff --git a/configobject/nullrows/nullrows.go b/configobject/nullrows/nullrows.go index 82e49b73..45fe8e5e 100644 --- a/configobject/nullrows/nullrows.go +++ b/configobject/nullrows/nullrows.go @@ -52,7 +52,7 @@ func InsertNullRows(super *supervisor.Supervisor) { // *_downtime_history execFunc( objectType + "_downtime_history", - fmt.Sprintf("REPLACE INTO %s_downtime_history(downtime_id, environment_id, %s_id, triggered_by_id, entry_time, author, comment, is_fixed, duration, scheduled_start_time, scheduled_end_time, was_started, actual_start_time, actual_end_time, was_cancelled, is_in_effect, trigger_time, deletion_time) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", objectType, objectType), + fmt.Sprintf("REPLACE INTO %s_downtime_history(downtime_id, environment_id, %s_id, triggered_by_id, entry_time, author, comment, is_flexible, duration, scheduled_start_time, scheduled_end_time, was_started, actual_start_time, actual_end_time, was_cancelled, is_in_effect, trigger_time, deletion_time) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", objectType, objectType), emptyID, super.EnvId, emptyID, emptyID, 0, "", "", "y", 0, 0, 0, "y", 0, 0, "y", "y", 0, 0, ) diff --git a/configobject/objecttypes/downtime/downtime.go b/configobject/objecttypes/downtime/downtime.go index 3e885bb3..15a7ac91 100644 --- a/configobject/objecttypes/downtime/downtime.go +++ b/configobject/objecttypes/downtime/downtime.go @@ -23,7 +23,7 @@ var ( "scheduled_start_time", "scheduled_end_time", "duration", - "is_fixed", + "is_flexible", "is_in_effect", "actual_start_time", "actual_end_time", @@ -46,7 +46,7 @@ type Downtime struct { ScheduledStartTime float64 `json:"scheduled_start_time"` ScheduledEndTime float64 `json:"scheduled_end_time"` Duration float64 `json:"duration"` - IsFixed bool `json:"is_fixed"` + IsFlexible bool `json:"is_flexible"` IsInEffect bool `json:"is_in_effect"` ActualStartTime float64 `json:"actual_start_time"` ActualEndTime float64 `json:"actual_end_time"` @@ -83,7 +83,7 @@ func (d *Downtime) UpdateValues() []interface{} { d.ScheduledStartTime, d.ScheduledEndTime, d.Duration, - utils.Bool[d.IsFixed], + utils.Bool[d.IsFlexible], utils.Bool[d.IsInEffect], d.ActualStartTime, d.ActualEndTime, diff --git a/etc/schema/mysql/downtime.sql b/etc/schema/mysql/downtime.sql index e8f880b7..23531ee6 100644 --- a/etc/schema/mysql/downtime.sql +++ b/etc/schema/mysql/downtime.sql @@ -19,7 +19,7 @@ CREATE TABLE downtime ( scheduled_start_time bigint(20) unsigned NOT NULL, scheduled_end_time bigint(20) unsigned NOT NULL, duration bigint(20) unsigned NOT NULL, - is_fixed enum('y', 'n') NOT NULL, + is_flexible enum('y', 'n') NOT NULL, is_in_effect enum('y', 'n') NOT NULL, actual_start_time bigint(20) unsigned DEFAULT NULL COMMENT 'Time when the host went into a problem state during the downtimes timeframe', diff --git a/etc/schema/mysql/host.sql b/etc/schema/mysql/host.sql index 6f896446..98631ea6 100644 --- a/etc/schema/mysql/host.sql +++ b/etc/schema/mysql/host.sql @@ -190,7 +190,7 @@ CREATE TABLE host_downtime_history ( entry_time bigint(20) unsigned NOT NULL, author varchar(255) NOT NULL COLLATE utf8mb4_unicode_ci, comment text NOT NULL, - is_fixed enum('y', 'n') NOT NULL, + is_flexible enum('y', 'n') NOT NULL, duration bigint(20) unsigned NOT NULL, scheduled_start_time bigint(20) unsigned NOT NULL, scheduled_end_time bigint(20) unsigned NOT NULL, diff --git a/etc/schema/mysql/service.sql b/etc/schema/mysql/service.sql index 42ebdf04..f7d304a5 100644 --- a/etc/schema/mysql/service.sql +++ b/etc/schema/mysql/service.sql @@ -183,7 +183,7 @@ CREATE TABLE service_downtime_history ( entry_time bigint(20) unsigned NOT NULL, author varchar(255) NOT NULL COLLATE utf8mb4_unicode_ci, comment text NOT NULL, - is_fixed enum('y', 'n') NOT NULL, + is_flexible enum('y', 'n') NOT NULL, duration bigint(20) unsigned NOT NULL, scheduled_start_time bigint(20) unsigned NOT NULL, scheduled_end_time bigint(20) unsigned NOT NULL,