fix: use MySQL-compatible datetime format for cloned_at
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:
2026-06-21 14:39:36 +08:00
parent 18e50c78d5
commit 1359c5c339
+1 -1
View File
@@ -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 {