fix: use MySQL-compatible datetime format for cloned_at
Deploy PR-Helper / deploy (push) Successful in 22s
Deploy PR-Helper / deploy (push) Successful in 22s
RFC3339 format (T separator, Z suffix) is rejected by MySQL DATETIME columns. Use '2006-01-02 15:04:05' instead.
This commit is contained in:
+1
-1
@@ -239,7 +239,7 @@ func (h *ReposHandler) CloneRepo(c *gin.Context) {
|
||||
}
|
||||
|
||||
// Save to database with user_id
|
||||
now := time.Now().Format(time.RFC3339)
|
||||
now := time.Now().Format("2006-01-02 15:04:05")
|
||||
res, err := h.db.Exec(`INSERT INTO repositories (user_id, url, local_path, size_bytes, cloned_at, last_used) VALUES (?, ?, ?, ?, ?, ?)`,
|
||||
user.ID, req.URL, repoDir, result.SizeBytes, now, now)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user