Files
matrix-rust-sdk/crates/matrix-sdk-sqlite/migrations/event_cache_store/001_init.sql
T
Kévin Commaille 01e2db1f52 base: Move media cache to new EventCacheStore trait (#3858)
Allows to save media in a different path than the state store.

This adds a "last_access" field to the SQLite implementation, to prepare
for future work on a media retention policy.

This removes the IndexedDB media cache implementation, because as far as
I know it is currently unused, and I have no idea how to implement
efficiently the planned media retention policy with a key-value store.

Closes #1810.

- [x] Public API changes documented in changelogs (optional)

---------

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2024-08-22 10:36:43 +02:00

15 lines
327 B
SQL

-- basic kv metadata like the database version and store cipher
CREATE TABLE "kv" (
"key" TEXT PRIMARY KEY NOT NULL,
"value" BLOB NOT NULL
);
CREATE TABLE "media" (
"uri" BLOB NOT NULL,
"format" BLOB NOT NULL,
"data" BLOB NOT NULL,
"last_access" INTEGER NOT NULL,
PRIMARY KEY ("uri", "format")
);