From 3eb34650793f0759eb4912f188eaf595b2f2babc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A1=9C=E8=8F=AF?= Date: Tue, 16 May 2023 01:56:10 +0800 Subject: [PATCH] =?UTF-8?q?=E8=81=B2=E6=98=8E=E5=A4=A7=E8=88=87=E7=B4=84?= =?UTF-8?q?=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/Image.go | 4 ++-- models/Model.go | 4 ++-- models/Server.go | 4 ++-- models/Tag.go | 4 ++-- models/Task.go | 4 ++-- models/session.go | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/models/Image.go b/models/Image.go index 629daf0..6e49b3a 100644 --- a/models/Image.go +++ b/models/Image.go @@ -18,8 +18,8 @@ type Image struct { Seed int `json:"seed"` // Random seed (minimum: 0; maximum: 2147483647) FromImage string `json:"from_image"` // Image to start from UserID int `json:"user_id"` - CreatedAt time.Time `json:"created_at" gorm:"default:CURRENT_TIMESTAMP;autoCreateTime"` - UpdatedAt time.Time `json:"updated_at" gorm:"default:CURRENT_TIMESTAMP;autoUpdateTime"` + CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime"` + UpdatedAt time.Time `json:"updated_at" gorm:"autoUpdateTime"` } func init() { diff --git a/models/Model.go b/models/Model.go index 01593cc..4f5de41 100644 --- a/models/Model.go +++ b/models/Model.go @@ -18,8 +18,8 @@ type Model struct { Image string `json:"image"` // 封面圖片實際地址 Tags string `json:"tags"` UserID int `json:"user_id"` - CreatedAt time.Time `json:"created_at" gorm:"default:CURRENT_TIMESTAMP;autoCreateTime"` - UpdatedAt time.Time `json:"updated_at" gorm:"default:CURRENT_TIMESTAMP;autoUpdateTime"` + CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime"` + UpdatedAt time.Time `json:"updated_at" gorm:"autoUpdateTime"` } func init() { diff --git a/models/Server.go b/models/Server.go index 43d0ce3..47549c6 100644 --- a/models/Server.go +++ b/models/Server.go @@ -13,8 +13,8 @@ type Server struct { Port int `json:"port"` Username string `json:"username"` Password string `json:"password"` - CreatedAt time.Time `json:"created_at" gorm:"default:CURRENT_TIMESTAMP;autoCreateTime"` - UpdatedAt time.Time `json:"updated_at" gorm:"default:CURRENT_TIMESTAMP;autoUpdateTime"` + CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime"` + UpdatedAt time.Time `json:"updated_at" gorm:"autoUpdateTime"` } func init() { diff --git a/models/Tag.go b/models/Tag.go index 0e01c62..cc386d5 100644 --- a/models/Tag.go +++ b/models/Tag.go @@ -8,8 +8,8 @@ import ( type Tag struct { ID int `json:"id" gorm:"primary_key"` Name string `json:"name"` - CreatedAt time.Time `json:"created_at" gorm:"default:CURRENT_TIMESTAMP;autoCreateTime"` - UpdatedAt time.Time `json:"updated_at" gorm:"default:CURRENT_TIMESTAMP;autoUpdateTime"` + CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime"` + UpdatedAt time.Time `json:"updated_at" gorm:"autoUpdateTime"` } func init() { diff --git a/models/Task.go b/models/Task.go index d36c8bc..6fe0b28 100644 --- a/models/Task.go +++ b/models/Task.go @@ -9,8 +9,8 @@ type Task struct { Status string `json:"status"` // (initial|ready|waiting|running|success|error) Progress int `json:"progress"` // (0-100) UserID int `json:"user_id"` - CreatedAt time.Time `json:"created_at" gorm:"default:CURRENT_TIMESTAMP;autoCreateTime"` - UpdatedAt time.Time `json:"updated_at" gorm:"default:CURRENT_TIMESTAMP;autoUpdateTime"` + CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime"` + UpdatedAt time.Time `json:"updated_at" gorm:"autoUpdateTime"` } //// 推理任務 diff --git a/models/session.go b/models/session.go index cd53ef0..4adf508 100644 --- a/models/session.go +++ b/models/session.go @@ -10,8 +10,8 @@ type Session struct { IP string `json:"ip"` UserID int `json:"user_id"` UserAgent string `json:"user_agent"` - CreatedAt time.Time `json:"created_at" gorm:"default:CURRENT_TIMESTAMP;autoCreateTime"` - UpdatedAt time.Time `json:"updated_at" gorm:"default:CURRENT_TIMESTAMP;autoUpdateTime"` + CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime"` + UpdatedAt time.Time `json:"updated_at" gorm:"autoUpdateTime"` } func init() {