fix: 更新appcodes_kv导入SQL,匹配parentid+k唯一索引
This commit is contained in:
parent
56de21a7ce
commit
67e61da2fd
@ -84,8 +84,8 @@ def import_data_json(cursor, filepath):
|
|||||||
cursor.execute("""
|
cursor.execute("""
|
||||||
INSERT INTO appcodes_kv (id, parentid, k, v)
|
INSERT INTO appcodes_kv (id, parentid, k, v)
|
||||||
VALUES (%s, %s, %s, %s)
|
VALUES (%s, %s, %s, %s)
|
||||||
ON DUPLICATE KEY UPDATE v=VALUES(v)
|
ON DUPLICATE KEY UPDATE id=VALUES(id), v=VALUES(v)
|
||||||
""", (item['id'], item.get('parentid', ''), item['k'], item['v']))
|
""", (item['id'], item['parentid'], item['k'], item['v']))
|
||||||
print(f" appcodes_kv: {len(appcodes_kv)} 条")
|
print(f" appcodes_kv: {len(appcodes_kv)} 条")
|
||||||
|
|
||||||
return len(appcodes), len(appcodes_kv)
|
return len(appcodes), len(appcodes_kv)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user