Add a timestamp column to profile_updates

Also add some comments to some fields.
This commit is contained in:
Jason Robinson
2026-05-27 15:57:48 +03:00
parent 343d4dffe0
commit 386958cbda
2 changed files with 8 additions and 1 deletions
@@ -459,6 +459,7 @@ class ProfileWorkerStore(SQLBaseStore):
"instance_name": self._instance_name,
"user_id": user_id_str,
"field_name": field_name,
"inserted_ts": self.clock.time_msec(),
},
)
@@ -16,8 +16,14 @@ CREATE TABLE profile_updates (
stream_id BIGINT NOT NULL PRIMARY KEY,
instance_name TEXT NOT NULL,
-- The full user ID
user_id TEXT NOT NULL,
field_name TEXT NOT NULL
-- Profile field name that has been updated,
-- see https://spec.matrix.org/unstable/client-server-api/#profiles
field_name TEXT NOT NULL,
-- Unix timestamp for debugging purposes
inserted_ts BIGINT NOT NULL
);
CREATE INDEX profile_updates_by_user ON profile_updates (user_id, stream_id);