db: add telegram_file table

Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
This commit is contained in:
Sumner Evans
2024-07-01 13:24:51 -06:00
parent a2b810e34e
commit cbba340da6
9 changed files with 141 additions and 17 deletions
+15
View File
@@ -30,3 +30,18 @@ CREATE TABLE telegram_channel_access_hashes (
PRIMARY KEY (user_id, channel_id)
);
CREATE TABLE telegram_file (
id TEXT PRIMARY KEY,
mxc TEXT NOT NULL,
mime_type TEXT,
was_converted BOOLEAN NOT NULL DEFAULT false,
timestamp BIGINT NOT NULL DEFAULT 0,
size BIGINT,
width INTEGER,
height INTEGER,
thumbnail TEXT,
decryption_info jsonb,
FOREIGN KEY (thumbnail) REFERENCES telegram_file(id)
ON UPDATE CASCADE ON DELETE SET NULL
);