From e7c2d878bcbf00b2bf5f97a200356a9a5f481878 Mon Sep 17 00:00:00 2001 From: cuihom <1036633142@qq.com> Date: Fri, 18 Oct 2024 16:38:27 +0800 Subject: [PATCH] Update index.js When updating the snapshot table, the metadata field was mistakenly updated to the data field --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 1b0f0a2..0a093b1 100644 --- a/index.js +++ b/index.js @@ -80,7 +80,7 @@ PostgresDB.prototype.commit = async function(collection, id, op, snapshot, optio WHERE collection = $1 AND doc_id = $2 FOR UPDATE ) - ON CONFLICT (collection, doc_id) DO UPDATE SET version = $3, data = $5, doc_type = $4, metadata = $5 + ON CONFLICT (collection, doc_id) DO UPDATE SET version = $3, data = $5, doc_type = $4, metadata = $6 RETURNING version ) INSERT INTO ops (collection, doc_id, version, operation)