Fix get_attribute_history query to not use template_id column

This commit is contained in:
OpenClaw Bot
2026-02-20 00:21:14 +08:00
parent a3e782d365
commit d1ab36a543

View File

@@ -829,9 +829,8 @@ class DatabaseManager:
where_clause = " AND ".join(conditions) if conditions else "1=1" where_clause = " AND ".join(conditions) if conditions else "1=1"
rows = conn.execute( rows = conn.execute(
f"""SELECT ah.*, at.name as template_name f"""SELECT ah.*
FROM attribute_history ah FROM attribute_history ah
JOIN attribute_templates at ON ah.template_id = at.id
WHERE {where_clause} WHERE {where_clause}
ORDER BY ah.changed_at DESC LIMIT ?""", ORDER BY ah.changed_at DESC LIMIT ?""",
params + [limit] params + [limit]