diff --git a/management/server/account.go b/management/server/account.go index 6082bd67a..1810c6b41 100644 --- a/management/server/account.go +++ b/management/server/account.go @@ -308,7 +308,7 @@ type UserInfo struct { IsServiceUser bool `json:"is_service_user"` IsBlocked bool `json:"is_blocked"` NonDeletable bool `json:"non_deletable"` - LastLogin time.Time `json:"last_login" gorm:"default:null"` + LastLogin time.Time `json:"last_login"` Issued string `json:"issued"` IntegrationReference integration_reference.IntegrationReference `json:"-"` Permissions UserPermissions `json:"permissions"` diff --git a/management/server/peer/peer.go b/management/server/peer/peer.go index 03cd42d7f..34d791844 100644 --- a/management/server/peer/peer.go +++ b/management/server/peer/peer.go @@ -40,7 +40,7 @@ type Peer struct { InactivityExpirationEnabled bool // LastLogin the time when peer performed last login operation - LastLogin time.Time `gorm:"default:null"` + LastLogin time.Time // CreatedAt records the time the peer was created CreatedAt time.Time // Indicate ephemeral peer attribute @@ -51,7 +51,7 @@ type Peer struct { type PeerStatus struct { //nolint:revive // LastSeen is the last time peer was connected to the management service - LastSeen time.Time `gorm:"default:null"` + LastSeen time.Time // Connected indicates whether peer is connected to the management service or not Connected bool // LoginExpired diff --git a/management/server/personal_access_token.go b/management/server/personal_access_token.go index dde7e0571..f46666112 100644 --- a/management/server/personal_access_token.go +++ b/management/server/personal_access_token.go @@ -35,7 +35,7 @@ type PersonalAccessToken struct { // scope could be added in future CreatedBy string CreatedAt time.Time - LastUsed time.Time `gorm:"default:null"` + LastUsed time.Time } func (t *PersonalAccessToken) Copy() *PersonalAccessToken { diff --git a/management/server/setupkey.go b/management/server/setupkey.go index 17b8458a7..43b6e02c9 100644 --- a/management/server/setupkey.go +++ b/management/server/setupkey.go @@ -87,7 +87,7 @@ type SetupKey struct { // UsedTimes indicates how many times the key was used UsedTimes int // LastUsed last time the key was used for peer registration - LastUsed time.Time `gorm:"default:null"` + LastUsed time.Time // AutoGroups is a list of Group IDs that are auto assigned to a Peer when it uses this key to register AutoGroups []string `gorm:"serializer:json"` // UsageLimit indicates the number of times this key can be used to enroll a machine. diff --git a/management/server/user.go b/management/server/user.go index dbe6c662a..9fdd3a6ee 100644 --- a/management/server/user.go +++ b/management/server/user.go @@ -74,7 +74,7 @@ type User struct { // Blocked indicates whether the user is blocked. Blocked users can't use the system. Blocked bool // LastLogin is the last time the user logged in to IdP - LastLogin time.Time `gorm:"default:null"` + LastLogin time.Time // CreatedAt records the time the user was created CreatedAt time.Time