Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

fix(mysql): handle CreateMemo custom timestamps with FROM_UNIXTIME (#5673)

Mudkip09d73e8b6e16
diff --git a/store/db/mysql/memo.go b/store/db/mysql/memo.go
index 05d45ea27..5aeae6cd4 100644
--- a/store/db/mysql/memo.go
+++ b/store/db/mysql/memo.go
@@ -29,12 +29,12 @@ func (d *DB) CreateMemo(ctx context.Context, create *store.Memo) (*store.Memo, e
// Add custom timestamps if provided
if create.CreatedTs != 0 {
fields = append(fields, "`created_ts`")
- placeholder = append(placeholder, "?")
+ placeholder = append(placeholder, "FROM_UNIXTIME(?)")
args = append(args, create.CreatedTs)
}
if create.UpdatedTs != 0 {
fields = append(fields, "`updated_ts`")
- placeholder = append(placeholder, "?")
+ placeholder = append(placeholder, "FROM_UNIXTIME(?)")
args = append(args, create.UpdatedTs)
}