mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-24 03:06:38 +00:00
Delete sql_hooks.go
This commit is contained in:
@@ -1,32 +0,0 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
func GetDefaultTimezone() time.Time {
|
||||
return time.Date(1, 1, 1, 1, 1, 1, 1, time.Local)
|
||||
}
|
||||
|
||||
func (u *SetupKey) BeforeSave(tx *gorm.DB) (err error) {
|
||||
|
||||
if u.CreatedAt.IsZero() {
|
||||
u.CreatedAt = GetDefaultTimezone()
|
||||
}
|
||||
|
||||
if u.ExpiresAt.IsZero() {
|
||||
u.ExpiresAt = GetDefaultTimezone()
|
||||
}
|
||||
|
||||
if u.UpdatedAt.IsZero() {
|
||||
u.UpdatedAt = GetDefaultTimezone()
|
||||
}
|
||||
|
||||
if u.LastUsed.IsZero() {
|
||||
u.LastUsed = GetDefaultTimezone()
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user