20 lines
691 B
Go
20 lines
691 B
Go
package models
|
|
|
|
import "time"
|
|
|
|
// One-to-one config bound to a device GUID.
|
|
type DeviceConfig struct {
|
|
DeviceGUID string `gorm:"primaryKey;size:64"` // 1:1 with Device.GUID
|
|
// Fields reflect your device JSON keys (m_*)
|
|
MGuid string `gorm:"size:64;not null"` // duplicate for device FW convenience
|
|
MRecordingDuration int `gorm:"not null;default:240"`
|
|
MBaseURL string `gorm:"size:512;not null"`
|
|
MPolling int `gorm:"not null;default:30"`
|
|
MJitter int `gorm:"not null;default:10"`
|
|
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
|
|
Device Device `gorm:"constraint:OnDelete:CASCADE;foreignKey:DeviceGUID;references:GUID"`
|
|
}
|