Add active user session tracking from agent user :0 2026-07-16 15:46
user pts/0 2026-07-16 15:50 (:0) user pts/1 2026-07-16 16:46 (:0) user pts/2 2026-07-17 09:05 (:0) to server UI
This commit is contained in:
@@ -38,3 +38,11 @@ def run_migrations():
|
||||
with engine.connect() as conn:
|
||||
conn.execute(text("ALTER TABLE audit_log ADD COLUMN username TEXT"))
|
||||
conn.commit()
|
||||
|
||||
# Heartbeat: add sessions column if missing
|
||||
if "heartbeats" in insp.get_table_names():
|
||||
hb_cols = {c["name"] for c in insp.get_columns("heartbeats")}
|
||||
if "sessions" not in hb_cols:
|
||||
with engine.connect() as conn:
|
||||
conn.execute(text("ALTER TABLE heartbeats ADD COLUMN sessions TEXT"))
|
||||
conn.commit()
|
||||
|
||||
Reference in New Issue
Block a user