From 67e61da2fd49749c809fd239cdab77d6e8d0ecc3 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Wed, 17 Jun 2026 15:36:14 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0appcodes=5Fkv=E5=AF=BC?= =?UTF-8?q?=E5=85=A5SQL=EF=BC=8C=E5=8C=B9=E9=85=8Dparentid+k=E5=94=AF?= =?UTF-8?q?=E4=B8=80=E7=B4=A2=E5=BC=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- import_codes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/import_codes.py b/import_codes.py index e561d3f..214758f 100644 --- a/import_codes.py +++ b/import_codes.py @@ -84,8 +84,8 @@ def import_data_json(cursor, filepath): cursor.execute(""" INSERT INTO appcodes_kv (id, parentid, k, v) VALUES (%s, %s, %s, %s) - ON DUPLICATE KEY UPDATE v=VALUES(v) - """, (item['id'], item.get('parentid', ''), item['k'], item['v'])) + ON DUPLICATE KEY UPDATE id=VALUES(id), v=VALUES(v) + """, (item['id'], item['parentid'], item['k'], item['v'])) print(f" appcodes_kv: {len(appcodes_kv)} 条") return len(appcodes), len(appcodes_kv)