diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 11:41:41 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 11:41:41 +0000 |
commit | 5d920465245906e2250c288c2b1ffea608a37539 (patch) | |
tree | 8d52f82e5d4a1717f136c7e5f6c389464c403e79 /cmd/icingadb-migrate/convert.go | |
parent | Releasing progress-linux version 1.1.1-2~progress7.99u1. (diff) | |
download | icingadb-5d920465245906e2250c288c2b1ffea608a37539.tar.xz icingadb-5d920465245906e2250c288c2b1ffea608a37539.zip |
Merging upstream version 1.2.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'cmd/icingadb-migrate/convert.go')
-rw-r--r-- | cmd/icingadb-migrate/convert.go | 33 |
1 files changed, 9 insertions, 24 deletions
diff --git a/cmd/icingadb-migrate/convert.go b/cmd/icingadb-migrate/convert.go index e14746e..5cfa7bd 100644 --- a/cmd/icingadb-migrate/convert.go +++ b/cmd/icingadb-migrate/convert.go @@ -150,19 +150,9 @@ func convertCommentRows( }, AckHistoryUpserter: history.AckHistoryUpserter{ClearTime: clearTime}, SetTime: setTime, - Author: icingadbTypes.String{ - NullString: sql.NullString{ - String: row.AuthorName, - Valid: true, - }, - }, - Comment: icingadbTypes.String{ - NullString: sql.NullString{ - String: row.CommentData, - Valid: true, - }, - }, - ExpireTime: convertTime(row.ExpirationTime, 0), + Author: icingadbTypes.MakeString(row.AuthorName), + Comment: icingadbTypes.MakeString(row.CommentData), + ExpireTime: convertTime(row.ExpirationTime, 0), IsPersistent: icingadbTypes.Bool{ Bool: row.IsPersistent != 0, Valid: true, @@ -656,13 +646,8 @@ func convertNotificationRows( SendTime: ts, State: row.State, PreviousHardState: previousHardState, - Text: icingadbTypes.String{ - NullString: sql.NullString{ - String: text, - Valid: true, - }, - }, - UsersNotified: row.ContactsNotified, + Text: icingadbTypes.MakeString(text), + UsersNotified: row.ContactsNotified, }) allHistory = append(allHistory, &history.HistoryNotification{ @@ -739,8 +724,8 @@ type stateRow = struct { StateTimeUsec uint32 State uint8 StateType uint8 - CurrentCheckAttempt uint16 - MaxCheckAttempts uint16 + CurrentCheckAttempt uint32 + MaxCheckAttempts uint32 LastState uint8 LastHardState uint8 Output sql.NullString @@ -813,10 +798,10 @@ func convertStateRows( HardState: row.LastHardState, PreviousSoftState: row.LastState, PreviousHardState: previousHardState, - CheckAttempt: uint8(row.CurrentCheckAttempt), + CheckAttempt: row.CurrentCheckAttempt, Output: icingadbTypes.String{NullString: row.Output}, LongOutput: icingadbTypes.String{NullString: row.LongOutput}, - MaxCheckAttempts: uint32(row.MaxCheckAttempts), + MaxCheckAttempts: row.MaxCheckAttempts, CheckSource: icingadbTypes.String{NullString: row.CheckSource}, }) |