Added default null value for datetime.

This commit is contained in:
İsmail
2024-11-06 21:23:30 +03:00
parent 1946bf28c1
commit 77b1324cf1
4 changed files with 5 additions and 5 deletions

View File

@@ -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"`
LastLogin time.Time `json:"last_login" gorm:"default:null"`
Issued string `json:"issued"`
IntegrationReference integration_reference.IntegrationReference `json:"-"`
Permissions UserPermissions `json:"permissions"`

View File

@@ -40,7 +40,7 @@ type Peer struct {
InactivityExpirationEnabled bool
// LastLogin the time when peer performed last login operation
LastLogin time.Time
LastLogin time.Time `gorm:"default:null"`
// 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
LastSeen time.Time `gorm:"default:null"`
// Connected indicates whether peer is connected to the management service or not
Connected bool
// LoginExpired

View File

@@ -35,7 +35,7 @@ type PersonalAccessToken struct {
// scope could be added in future
CreatedBy string
CreatedAt time.Time
LastUsed time.Time
LastUsed time.Time `gorm:"default:null"`
}
func (t *PersonalAccessToken) Copy() *PersonalAccessToken {

View File

@@ -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
LastUsed time.Time `gorm:"default:null"`
// 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.