Add global presence heartbeat and online tracking

This commit is contained in:
2026-02-26 10:53:56 +01:00
parent 60442b4335
commit 5eeef54e46
6 changed files with 56 additions and 1 deletions
+10 -1
View File
@@ -66,4 +66,13 @@ def init_db(app):
);
"""
)
db.commit()
# Lightweight migration support for existing databases.
user_columns = {
row["name"]
for row in db.execute("PRAGMA table_info(users)").fetchall()
}
if "last_seen_at" not in user_columns:
db.execute("ALTER TABLE users ADD COLUMN last_seen_at TIMESTAMP")
db.commit()