From 982b9ab9f80ff76cc3ee7bd0e59bee330d9dd686 Mon Sep 17 00:00:00 2001 From: Morgan Bazalgette Date: Fri, 8 Dec 2017 15:40:45 +0100 Subject: [PATCH] use coalesce rather than notes directly --- app/v1/manage_user.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/v1/manage_user.go b/app/v1/manage_user.go index aa39bae..54a028f 100644 --- a/app/v1/manage_user.go +++ b/app/v1/manage_user.go @@ -193,7 +193,7 @@ func rapLog(md common.MethodData, message string) { func appendToUserNotes(md common.MethodData, message string, user int) { message = "\n[" + time.Now().Format("2006-01-02 15:04:05") + "] API: " + message - _, err := md.DB.Exec("UPDATE users SET notes = CONCAT(notes, ?) WHERE id = ?", + _, err := md.DB.Exec("UPDATE users SET notes = CONCAT(COALESCE(notes, ''), ?) WHERE id = ?", message, user) if err != nil { md.Err(err)