Add global presence heartbeat and online tracking
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user