mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-08 01:06:59 +08:00
perf: Optimize Assistant Application Migration Script
This commit is contained in:
committed by
fit2cloud-chenyw
parent
64bf0f5f63
commit
87931547b2
@@ -31,7 +31,9 @@ def upgrade():
|
||||
try:
|
||||
config = json.loads(row.configuration) if isinstance(row.configuration, str) else row.configuration
|
||||
oid_value = config.get('oid', 1) if isinstance(config, dict) else 1
|
||||
if isinstance(oid_value, int) and oid_value != 1:
|
||||
if oid_value != 1:
|
||||
if not isinstance(oid_value, int):
|
||||
oid_value = int(oid_value)
|
||||
conn.execute(
|
||||
sa.text("UPDATE sys_assistant SET oid = :oid WHERE id = :id"),
|
||||
{"oid": oid_value, "id": row.id}
|
||||
|
||||
Reference in New Issue
Block a user