Skip to content

Commit 8793154

Browse files
perf: Optimize Assistant Application Migration Script
1 parent 64bf0f5 commit 8793154

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

backend/alembic/versions/061_assistant_oid_ddl.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ def upgrade():
3131
try:
3232
config = json.loads(row.configuration) if isinstance(row.configuration, str) else row.configuration
3333
oid_value = config.get('oid', 1) if isinstance(config, dict) else 1
34-
if isinstance(oid_value, int) and oid_value != 1:
34+
if oid_value != 1:
35+
if not isinstance(oid_value, int):
36+
oid_value = int(oid_value)
3537
conn.execute(
3638
sa.text("UPDATE sys_assistant SET oid = :oid WHERE id = :id"),
3739
{"oid": oid_value, "id": row.id}

0 commit comments

Comments
 (0)