store: move the access_hash and username to separate per-user table

Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
This commit is contained in:
Sumner Evans
2024-08-08 12:12:17 -06:00
parent aeb8fba288
commit 838f291220
7 changed files with 129 additions and 22 deletions
@@ -31,6 +31,16 @@ CREATE TABLE telegram_channel_access_hashes (
PRIMARY KEY (user_id, channel_id)
);
CREATE TABLE telegram_user_metadata (
receiver_id INTEGER,
user_id INTEGER,
access_hash INTEGER NOT NULL,
username TEXT,
PRIMARY KEY (receiver_id, user_id)
);
CREATE TABLE telegram_file (
id TEXT PRIMARY KEY,
mxc TEXT NOT NULL,