srdusr
aboutsummaryrefslogtreecommitdiffstats
path: root/crates/server/migrations
diff options
context:
space:
mode:
Diffstat (limited to 'crates/server/migrations')
-rw-r--r--crates/server/migrations/0008_presence.sql7
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/server/migrations/0008_presence.sql b/crates/server/migrations/0008_presence.sql
new file mode 100644
index 0000000..1c8607e
--- /dev/null
+++ b/crates/server/migrations/0008_presence.sql
@@ -0,0 +1,7 @@
+- Presence, for showing how many of your friends are around right now.
+- Written as a plain timestamp column rather than a separate table: it is a
+- single value per user, overwritten in place, with no history worth keeping.
+ALTER TABLE users ADD COLUMN last_seen TEXT;
+
+- The friends list filters on it for every accepted friendship.
+CREATE INDEX idx_users_last_seen ON users(last_seen);