Replace is_fixed with is_flexible

This commit is contained in:
Alexander A. Klimov 2019-10-21 15:41:01 +02:00
parent c4c38ceee0
commit a49fcd140c
6 changed files with 9 additions and 9 deletions

View file

@ -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"],

View file

@ -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,
)

View file

@ -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,

View file

@ -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',

View file

@ -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,

View file

@ -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,