1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

chore: add migration for heartbeats count

This commit is contained in:
Ferdinand Mütsch
2021-12-22 15:44:37 +01:00
parent 92f6d44606
commit ec236909c9
4 changed files with 53 additions and 3 deletions

View File

@@ -31,7 +31,7 @@ type Summary struct {
OperatingSystems SummaryItems `json:"operating_systems" gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE"`
Machines SummaryItems `json:"machines" gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE"`
Labels SummaryItems `json:"labels" gorm:"-"` // labels are not persisted, but calculated at runtime, i.e. when summary is retrieved
NumHeartbeats int `json:"-"`
NumHeartbeats int `json:"-" gorm:"default:0"`
}
type SummaryItems []*SummaryItem